[PyQt] Threads with PyQt. Qt's or Python's?

dboddie at trolltech.com dboddie at trolltech.com
Tue Feb 3 13:08:27 GMT 2009


On Tue Feb 3 10:28:26 GMT 2009, Giovanni Bajo wrote:

> The trick is that a signal/slot connection across a thread is different
> from a normal one: in a normal connection, slots are called immediately,
> within the "emit()" call. Instead, in an asynchronous connection, when
> the signal is emitted, an event is posted to the main thread (posting
> events is thread-safe); then the receiving thread's exec loop will
> process the event and call the correct slot.

For those that don't already know about it, there's an example of inter-
thread signal-slot communication in the PyQt Wiki:

  http://www.diotavelli.net/PyQtWiki/Threading,_Signals_and_Slots

The Mandelbrot example included with PyQt4 also shows this technique.

David


More information about the PyQt mailing list