[PyQt] Question about QTimer and QThreads

Andreas Pakulat apaku at gmx.de
Mon Oct 29 08:16:52 GMT 2007

On 29.10.07 08:40:38, V. Armando Sole wrote:
> Hello Darren,
> At 19:07 28/10/2007 -0400, Darren Dale wrote:
> > Anyway, changing my example to
> >use a.show() doesn't work, the thread's event loop is not started. I don't
> >see any recent discussion on the list that seems relevent.
> Please add the method:
>     def run(self):
>         self.timer.start(20)
> to your Dispatcher class (remove self.timer.start from the __init__) and call a.start() to start 
> your thread and not a.exec_().

That doesn't give him the eventloop either and thus the timer never
fires. What he really wants is running the 2nd event loop inside the
new thread, by calling self.exec_() from run().


Blow it out your ear.

More information about the PyQt mailing list