[PyKDE] Can you use a QTimer in a non-gui thread?

Solly Brown sollyb at cse.unsw.edu.au
Sat Oct 30 08:37:19 BST 2004


Can you create and use a QTimer in a non-gui thread?

The Trolltech documentation (at one point) seems to suggest that you 
shouldn't:

"Any operations that generate events must not be called by any thread 
other than the GUI thread. Examples of such operations are: creating a 
QWidget, QTimer,..."

Is that right?

I'm running a QTimer in my non-gui thread, which allows me to control the 
speed at which I'm processing my simulation data. Every timer click I do a 
bit more processing and then use a postEvent() to send the data across to 
the gui thread.

Am I wrong to do this? It seems to work fine on my machine, but I don't 
want it to break mysteriously in the future...!

Yours confusedly, Solly


-------------------------------------

Solly Brown

Robotics Group
Department of Artificial Intelligence
University of New South Wales / NICTA

e: sollyb at cse.unsw.edu.au
p: (02) 9385 7779
m: School of Computer Science and Engineering
    University of New South Wales
    NSW 2052
    Australia




More information about the PyQt mailing list