[Qt-interest] Basic QThread question

Sean Harmer sean.harmer at maps-technology.com
Thu May 6 11:26:43 CEST 2010


On Thursday 06 May 2010 10:21:23 Eirik Ulvik wrote:
> > I do not think this is correct. DevicePoller is not a QThread it is a
> > QObject so it has no started() signal.
> > 
> > Cheers,
> > 
> > Sean
> 
> Ahh, sorry. It should be in the PollingThread class.

Why? It is not needed at all. The object that does the work, DevicePoller, was 
created in the worker thread and so has affinity with the worker thread. 
Therefore the timer in DevicePoller will use the event loop of the worker 
thread.

You would only need to move the Thread to have affinity with itself if it is 
the thread that is doing the polling. As we have another object doing it for 
us this is not needed.

Cheers,

Sean



More information about the Qt-interest-old mailing list