[PyQt] OSX and threads

Phil Thompson phil at riverbankcomputing.co.uk
Sun Jun 10 10:14:03 BST 2007


On Sunday 10 June 2007 6:39 am, Kovid Goyal wrote:
> Think I sent my previous reply only to Phil.
> Changing to a=test(window) doesn't help.
> I'm using PyQt 20070606 with Qt 4.3.0 on OSX 10.4.8.
> sip is compiled with the -n option and PyQt with -e QtCore -e QtScg -e
> QtGui. Qt is compiled with -static -universal -no-nis -fast

sip's -n option isn't fully implemented yet - I'm surprised the code compiles.

The script runs fine for me with normal builds.

Phil

> On Saturday 09 June 2007 16:11:57 Phil Thompson wrote:
> > On Saturday 09 June 2007 11:35 pm, Kovid Goyal wrote:
> > > Hi,
> > >
> > > The following test code gives me an error on OSX but not on either
> > > windows or linux:
> > > from PyQt4.Qt import *
> > > import sys
> > > class test(QObject):
> > >   def __init__(self, window):
> > >     QObject.__init__(self)
> > >     self.window = window
> > >     self.startTimer(1000)
> > >     window.show()
> > >
> > > app = QApplication(sys.argv)
> > > window = QMainWindow()
> > > test(window)
> > > app.exec_()
> > >
> > > The error is:
> > > QObject::startTimer: QTimer can only be used with threads started with
> > > QThread
> > >
> > > What am I doing wrong?
> >
> > Not keeping a reference to the test instance?
> >
> > Phil
> >
> > !DSPAM:2,466b342e160002104433144!


More information about the PyQt mailing list