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

Giovanni Bajo rasky at develer.com
Mon Jan 19 17:17:20 GMT 2009


On 1/19/2009 5:37 PM, Frédéric wrote:

> I use python threads, but I have a serializer to push all Qt calls on a 
> queue, and this queue is processed from the main thread, using a QTimer 
> timeout signal.

This would work on Qt4 as well, but of course it's not ideal as you need 
a timer to poll the queue. It's much easier to use QThreads and simply 
post the events (or use the asynchronous signals).

Plus, you can now do non-trivial things from the secondary threads (eg: 
painting with QPainter over a QImage) so it's worth sitting down and 
analyzing all these possibilities before desiging the code with Qt4.

This is the correct link to get a broad overview:
http://doc.trolltech.com/4.4/threads.html
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com




More information about the PyQt mailing list