[PyQt] QWaitCondition and signals/slots across threads

Peter Bienstman Peter.Bienstman at ugent.be
Tue Sep 7 11:42:28 BST 2010


Hi,

Attached is a simple testcase which emits a signal from a worker thread, and 
then waits until the main thread has released a database connection.

It works fine under Linux, but under OSX Qt 4.7RC, PyQt 4.7.4, the slot never 
get's called, i.e. print "slot called" never gets executed.

From Googling around I know that putting the main thread to sleep with a 
QWaitCondition also puts the event loop to sleep. However, here we don't put 
the main thread to sleep, but only the worker thread, and only after we emit 
the signal.

What then is the reason that the slot never gets called on OSX?

Cheers,

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 1278 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100907/ab844277/attachment.py>


More information about the PyQt mailing list