PDA

View Full Version : Determine if QThread::currentThread is main thread?



chaoticbob
15th December 2008, 21:07
Is it possible for me to figure out if I'm the main thread or from a child thread from QThread::currentThread? Or do I have to keep track of the thread id and just against that?

Thanks.

fanat9
16th December 2008, 14:19
QApplication::instance()->thread() will give you main threadid.

chaoticbob
17th December 2008, 06:26
Brilliant! Thanks.