[Qt-interest] Basic QThread question
Sean Harmer
sean.harmer at maps-technology.com
Thu May 6 11:40:49 CEST 2010
Hi,
On Thursday 06 May 2010 10:32:20 Eirik Ulvik wrote:
> Den 06.05.2010 11:26, skrev Sean Harmer:
> > 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.
>
> Yes, but the OP does seem to get the code working but still running in
> the GUI thread. Based on my experience on a similar problem and
> referring to the previous list entry (see link in my first reply) this
> was the solution. Maybe this is not the case here, but it might be...
I know what you mean, but let's wait and see if the OP posts some more of his
main thread code as requested. :-)
Cheers,
Sean
More information about the Qt-interest-old
mailing list