以下成員源於類 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 ().