QProcessEnvironment Class
The QProcessEnvironment class holds the environment variables that can be passed to a program. More...
| Header: | #include <QProcessEnvironment> |
| qmake: | QT += core |
| Since: | Qt 4.6 |
This class was introduced in Qt 4.6.
Note: All functions in this class are reentrant.
Detailed Description
A process's environment is composed of a set of key=value pairs known as environment variables. The QProcessEnvironment class wraps that concept and allows easy manipulation of those variables. It's meant to be used along with QProcess, to set the environment for child processes. It cannot be used to change the current process's environment.
The environment of the calling process can be obtained using QProcessEnvironment::systemEnvironment().
On Unix systems, the variable names are case-sensitive. Note that the Unix environment allows both variable names and contents to contain arbitrary binary data (except for the NUL character). QProcessEnvironment will preserve such variables, but does not support manipulating variables whose names or values cannot be encoded by the current locale settings (see QTextCodec::codecForLocale).
On Windows, the variable names are case-insensitive, but case-preserving. QProcessEnvironment behaves accordingly.
See also QProcess, QProcess::systemEnvironment(), and QProcess::setProcessEnvironment().