View Full Version : QThread::IdlePriority not working?

7th April 2011, 04:23

I am new to qt, I want to run a piece of code when no other gui/other activity is running. So I created a thread with QThread::IdlePriority(mentioned in the documentation). But the thread is still running when i put a while loop in my main application. I am attaching a sample project. where am I going wrong? Please suggest pointers to achieve the same.


7th April 2011, 05:23
You are going wrong in thinking that your program will only be active when "no other gui/other activity is running".

7th April 2011, 10:04
I think that a QThread with IdlePriority on a multi-core-cpu will executed parallel. Are thread's the right thing? Do you realy want implement all the sync-stuff?
Or do you want google "qt onidle"?
which-qt-class-work-like-onidle (http://www.qtforum.org/article/14070/which-qt-class-work-like-onidle-function-of-mfc.html)