summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/src/snippets/qprocess-environment/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/snippets/qprocess-environment/main.cpp b/doc/src/snippets/qprocess-environment/main.cpp
index a143bf8..0fa0896 100644
--- a/doc/src/snippets/qprocess-environment/main.cpp
+++ b/doc/src/snippets/qprocess-environment/main.cpp
@@ -57,10 +57,10 @@ process.start("myapp");
{
//! [1]
QProcess process;
-QHash<QString, QString> env = QProcess::systemEnvironmentHash();
+QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("TMPDIR", "C:\\MyApp\\temp"); // Add an environment variable
-env["PATH"] += ";C:\\Bin";
-process.setEnvironment(env);
+env.insert("PATH", env.value("Path") + ";C:\\Bin");
+process.setProcessEnvironment(env);
process.start("myapp");
//! [1]
}