1

I have a 2.6 python installed with latest PySide Qt bindings. The following code hands if thread.start() line is uncommented. Anyone can suggest what i'm doing wrong?

from PySide.QtCore import *
from PySide.QtGui import *
import sys

app = QApplication( sys.argv )
window = QWidget()
window.show()
thread = QThread()
# thread.start()
app.exec_()
grigoryvp
  • 40,413
  • 64
  • 174
  • 277
  • I'm guessing it's because QThread::start tries to use the event loop which isn't running until you do app.exec_(), seems possible, anyway. – James Nov 18 '10 at 18:42
  • 1
    you asked about this in #pyside on IRC and got an answer for, didn't you? Care to put it as an answer and accept it? It may be helpful for others. – Chris Morgan Nov 23 '10 at 02:59
  • Sure thing. I just give over people some time to answer it. It's not very polite to answer own questions. – grigoryvp Nov 27 '10 at 13:18

1 Answers1

1

It'a a known PySide bug. The workaround is to subclass QThread and define run() method that calls exec_()

grigoryvp
  • 40,413
  • 64
  • 174
  • 277