Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-24619

QProcess: Make it possible to set native process creating flags



    • Commits:


      Please make it possible to pass native process creating flags when creating a process with the QProcess class.

      Something like QProcess::setNativeCreationFlags(), which of course would be platform-specific, would be extremely helpful.

      In particular, in our project we need to pass the CREATE_BREAKAWAY_FROM_JOB creating flag on the Win32 platform.

      This flags is required, because Windows (Vista and later) automatically adds the child process to a PCA (Program Compatibility Assistant) job object.

      As a consequence, the process can NOT be added to our own job object anymore - on Win32 processes can be assigned to exactly one job object.

      And once it has been assigned to a job object (e.g. the PCA job object), a process can NOT be assigend to another job object anymore. AssignProcessToJobObject() will simply fail

      Only by using the CREATE_BREAKAWAY_FROM_JOB flag in CreateProcess(), we can avoid getting added to the PCA job object and correct functionality of AssignProcessToJobObject() is restored.

      For details please read here:

      In addition to being able to set the CREATE_BREAKAWAY_FROM_JOB flag, it would also be great to be able to set CREATE_SUSPENDED when needed.

      Normally, on Win32, we would create a process with CREATE_SUSPENDED, add the new (but suspended) process to our job object and then resume the process.

      QProcess does not currently allow us to create a process in suspended state at all

      So please consider adding QProcess::setNativeCreationFlags() in a future version. Until then, we have to patch Qt for our requirements.

      We are pretty sure that this will be very helpful for other developers too...


          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              jbornema Joerg Bornemann
              mulder LoRd MuldeR
              2 Vote for this issue
              3 Start watching this issue



                  Gerrit Reviews

                  There are no open Gerrit changes