Priority of the application



  • Hi everyone,

    I just want to change the priority of my application to lowest for some certain reasons on Windows. I tried

    @QThread::currentThread()->setPriority(QThread::LowestPriority);@

    but the priority of the application is the same when I check it from the task manager. Could you please guide me how I can do it properly?

    thanks.



  • You can use,

    QProcess::pid();
    It will give you Q_PID which is the _PROCESS_INFORMATION structure on windows.
    You can then set the Process priority using SetPriorityClass win32 function using the information from process information structure.

    HTH.



  • [quote author="prady_80" date="1365770729"]You can use,

    QProcess::pid();
    It will give you Q_PID which is the _PROCESS_INFORMATION structure on windows.
    You can then set the Process priority using SetPriorityClass win32 function using the information from process information structure.

    HTH.[/quote]

    Thanks. I will give it a try.
    Don't qt has a way for this since I will implement the same things in MAC OS X as well.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.