[PyKDE] Threads and KApplication lock

Gordon Tyler gordon at doxxx.net
Sat Sep 11 14:39:45 BST 2004


Russell Valentine wrote:
> print "DEBUG: doing the lock"
> self.parentApp.lock()
> print "DEBUG: lock worked"
> 
> IE when it locks up I never see "lock worked".
> 
> I only have one QThread running.

You mean you have one QThread in addition to the one on which the event 
queue is processed?

As far as I recall, during processing of events in the queue, Qt will 
lock the application. Calling lock() while the app is already locked 
will block.

If you haven't already, I would suggest reading the Qt docs on 
threading: <http://doc.trolltech.com/3.3/threads.html> According to that 
page, you should only update widgets in the main event thread. To 
perform GUI updates from other threads, they must post a custom event to 
the event queue and you should perform the appropriate update in the 
handler for that custom event.

Ciao,
Gordon




More information about the PyQt mailing list