Obsolete Members for QProcess
The following members of class QProcess are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.
| ||environment() const|
| ||readChannelMode() const|
| ||setEnvironment(const QStringList & environment)|
| ||setReadChannelMode(ProcessChannelMode mode)|
| ||finished(int exitCode)|
Member Function Documentation
QStringList QProcess::environment() const
Returns the environment that QProcess will use when starting a process, or an empty QStringList if no environment has been set using setEnvironment() or setEnvironmentHash(). If no environment has been set, the environment of the calling process will be used.
Note: The environment settings are ignored on Windows CE and Symbian, as there is no concept of an environment.
This is an overloaded function.
Note:Signal finished is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:
ProcessChannelMode QProcess::readChannelMode() const
void QProcess::setEnvironment(const QStringList & environment)
Sets the environment that QProcess will use when starting a process to the environment specified which consists of a list of key=value pairs.
For example, the following code adds the
C:\\BIN directory to the list of executable paths (
PATHS) on Windows:
QProcess process; QStringList env = QProcess::systemEnvironment(); env << "TMPDIR=C:\\MyApp\\temp"; // Add an environment variable env.replaceInStrings(QRegExp("^PATH=(.*)", Qt::CaseInsensitive), "PATH=\\1;C:\\Bin"); process.setEnvironment(env); process.start("myapp");
Note: This function is less efficient than the setProcessEnvironment() function.
void QProcess::setReadChannelMode(ProcessChannelMode mode)
Use setProcessChannelMode(mode) instead.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.