Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Priority of the application

    General and Desktop
    2
    3
    3539
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dolevo last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • P
        prady_80 last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • D
          dolevo last edited by

          [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.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post