Obsolete Members for QProcess

QProcess クラスの以下のメンバーは非推奨となっています。これらは、古いソースコードが引き続き動作するように提供されているものです。新しいコードでの使用は強く推奨しません。

パブリック関数

(deprecated in 4.6) QStringList environment() const
(deprecated in 4.6) void setEnvironment(const QStringList &environment)

メンバー関数のドキュメント

[deprecated in 4.6] QStringList QProcess::environment() const

この関数はバージョン 4.6 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

QProcess が子プロセスに渡す環境を返します。setEnvironment() を使用して環境が設定されていない場合は、空のQStringList を返します。環境が設定されていない場合は、呼び出し元のプロセスの環境が使用されます。

processEnvironment()、setEnvironment()、およびsystemEnvironment()も参照してください 。

[deprecated in 4.6] void QProcess::setEnvironment(const QStringList &environment)

この関数はバージョン 4.6 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

QProcess が子プロセスに渡す環境変数を設定します。パラメータenvironment は、キーと値のペアからなるリストです。

たとえば、次のコードは環境変数 `TMPDIR` を追加します:

QProcess process;
QStringList env = QProcess::systemEnvironment();
env << "TMPDIR=C:\\MyApp\\temp"; // Add an environment variable
process.setEnvironment(env);
process.start("myapp");

注:この関数は 、setProcessEnvironment() 関数よりも効率が劣ります。

environment()、setProcessEnvironment()、およびsystemEnvironment()も参照してください 。

© 2026 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.