PDA

View Full Version : priority of QThread



quickNitin
13th May 2006, 11:46
Can we set priority of one of Qt Threads

nitin

georgie
13th May 2006, 11:59
You can in 4.1....what are you using

from the docs

void QThread::setPriority ( Priority priority )
This function sets the priority for a running thread. If the thread is not running, this function does nothing and returns immediately. Use start() to start a thread with a specific priority.
The priority argument can be any value in the QThread::Priority enum except for InheritPriorty.
This function was introduced in Qt 4.1.

quickNitin
13th May 2006, 12:49
i am currently using qt3.3.4

georgie
13th May 2006, 12:53
I had a look, and you can do it in 3.3 as well...you just gotta give the priority when you call start instead, e.g. this.start(QThread::TimeCriticalPriority)....the default is to inherit the same priority as the parent thread....

i think all this means is that you can't change it once you've set it....could be a little prohibitive, depending upon exactly what you want to do with it....