[Qt-interest] QThread Question

Donal O'Connor donaloconnor at gmail.com
Thu Aug 6 13:48:08 CEST 2009


Thanks Sean for your good explanations.

William,
I've indeed done this but had problems finding GUI thread ID but got this
via: QApplication::instance()->thread()->currentThreadId();
Both the slot thead ID and the GUI thread ID match so that's enough.

No wonder this application was running slow and things blocking eachother.

Thanks to everyone for their help, I've learned a lot.


Regards,
Donal

On Thu, Aug 6, 2009 at 12:30 PM, william.crocker at analog.com <
william.crocker at analog.com> wrote:

>
>
> Donal O'Connor wrote:
> > Hi,
> >
> > I've got code here written by somebody else that seems to make use of
> > several threads but I'm quite worried that the processing is not done in
> > a different thread like intended.
> >
>
> When in doubt, print the id of the current thread from
> the context of code in question and compare this with the
> id of the main thread.
>
> QThread *QThread::currentThread ()   [static]
>     Returns a pointer to a QThread which represents
>     the currently executing thread.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090806/e1c4eb55/attachment.html 


More information about the Qt-interest-old mailing list