以下成员源于类 QProcess 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。
(obsolete)
QStringList
|
environment () const |
(obsolete)
ProcessChannelMode
|
readChannelMode () const |
(obsolete)
void
|
setEnvironment (const QStringList & environment ) |
(obsolete)
void
|
setReadChannelMode (ProcessChannelMode mode ) |
(obsolete)
void
|
finished (int exitCode ) |
返回环境从 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.
注意: The environment settings are ignored on Windows CE and Symbian, as there is no concept of an environment.
另请参阅 processEnvironment (), setEnvironment (),和 systemEnvironment ().
[signal]
void
QProcess::
finished
(
int
exitCode
)
这是重载函数。
Use finished(int exitCode , QProcess::ExitStatus status) instead.
注意: 信号 finished 在此类中是重载。要使用函数指针句法连接到此信号,必须在静态铸造中指定信号类型,如此范例所示:
connect(process, static_cast<void(QProcess::*)(int)>(&QProcess::finished), [=](int exitCode){ /* ... */ });
Returns the read channel mode of the QProcess . This function is equivalent to processChannelMode ()
另请参阅 setReadChannelMode () 和 processChannelMode ().
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");
注意: This function is less efficient than the setProcessEnvironment () 函数。
另请参阅 environment (), setProcessEnvironment (),和 systemEnvironment ().
使用 setProcessChannelMode ( mode ) 代替。
另请参阅 readChannelMode () 和 setProcessChannelMode ().