Handle belowNormalPriority inside process launcher on Windows

Remove setCreateProcessArgumentModifier() from the ProcessInterface
API and replace it with belowNormalPriority flag.

Change-Id: I6bcb92e56c3a68af7fa3e3a1c8b8eb13e3a2e5a7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2021-08-09 12:17:13 +02:00
parent d5eea3f994
commit 8fa1a1f587
8 changed files with 43 additions and 14 deletions

View File

@@ -26,6 +26,13 @@
#include "processutils.h"
#include <QProcess>
#ifdef Q_OS_WIN
#ifdef QTCREATOR_PCH_H
#define CALLBACK WINAPI
#endif
#include <qt_windows.h>
#endif
namespace Utils {
QIODevice::OpenMode ProcessStartHandler::openMode() const
@@ -55,4 +62,16 @@ void ProcessStartHandler::handleProcessStarted(QProcess *process)
}
}
void ProcessStartHandler::setBelowNormalPriority(QProcess *process)
{
#ifdef Q_OS_WIN
process->setCreateProcessArgumentsModifier(
[](QProcess::CreateProcessArguments *args) {
args->flags |= BELOW_NORMAL_PRIORITY_CLASS;
});
#endif // Q_OS_WIN
}
} // namespace Utils