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
main.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 <QtCore>
5
7{
8 {
10QProcess process;
11QStringList env = QProcess::systemEnvironment();
12env << "TMPDIR=C:\\MyApp\\temp"; // Add an environment variable
13process.setEnvironment(env);
14process.start("myapp");
16 }
17
18 {
20QProcess process;
22env.insert("TMPDIR", "C:\\MyApp\\temp"); // Add an environment variable
23process.setProcessEnvironment(env);
24process.start("myapp");
26 }
27}
28
29int main(int argc, char *argv[])
30{
31 QCoreApplication app(argc, argv);
33 return app.exec();
34}
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
\inmodule QtCore
Definition qprocess.h:32
void insert(const QString &name, const QString &value)
Inserts the environment variable of name name and contents value into this QProcessEnvironment object...
Definition qprocess.cpp:285
static QProcessEnvironment systemEnvironment()
\inmodule QtCore
int main()
[0]
void startProcess()
Definition main.cpp:6
QApplication app(argc, argv)
[0]