Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qprocess-createprocessargumentsmodifier.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QCoreApplication>
5#include <QProcess>
6#include <qt_windows.h>
7
8int main(int argc, char *argv[])
9{
10 QCoreApplication app(argc, argv);
11
13 QProcess process;
14 process.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *args)
15 {
16 args->flags |= CREATE_NEW_CONSOLE;
17 args->startupInfo->dwFlags &= ~STARTF_USESTDHANDLES;
18 args->startupInfo->dwFlags |= STARTF_USEFILLATTRIBUTE;
19 args->startupInfo->dwFillAttribute = BACKGROUND_BLUE | FOREGROUND_RED
20 | FOREGROUND_INTENSITY;
21 });
22 process.start("C:\\Windows\\System32\\cmd.exe", QStringList() << "/k" << "title" << "The Child Process");
24
25 return app.exec();
26}
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
\inmodule QtCore
int main()
[0]
QList< QString > QStringList
Constructs a string list that contains the given string, str.
QApplication app(argc, argv)
[0]
QJSValueList args