Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Priority of the application
Qt 6.12 LTS is out! See what's new in the release blog

Priority of the application

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 4.1k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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
    0
    • P Offline
      P Offline
      prady_80
      wrote on last edited by
      #2

      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
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

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

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved