[PyQt] OSX and threads

Kovid Goyal kovid at theory.caltech.edu
Sat Jun 9 23:35:59 BST 2007


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?

Thanks,

Kovid.
-- 
_____________________________________

Kovid Goyal  MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125

home  : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid at theory.caltech.edu
web   : http://www.kovidgoyal.net
_____________________________________


More information about the PyQt mailing list