[Qt-interest] QWaitCondition and signals/slots across threads

Peter Bienstman Peter.Bienstman at ugent.be
Wed Sep 8 17:36:13 CEST 2010


Hi,

Attached is a simple (Python) 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://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100908/4c08b3c9/attachment.py 


More information about the Qt-interest-old mailing list