このページでは

QProcess::UnixProcessParameters Struct

struct QProcess::UnixProcessParameters

この構造体は Qt 6.6 で導入されました。

詳細な説明

注:この構造 体はUnixプラットフォームでのみ利用可能です

この構造体は、QProcess::setUnixProcessParameters() を使用して、子プロセスに Unix 固有の追加設定を渡すために使用できます。

そのメンバは次のとおりです。

  • UnixProcessParameters::flags フラグ。詳細はQProcess::UnixProcessFlags
  • UnixProcessParameters::lowestFileDescriptorToClose 閉じるべき最も低いファイル記述子。

flags フィールドで QProcess::UnixProcessFlags::CloseFileDescriptors フラグが設定されている場合、QProcess は子プロセスの実行前に、アプリケーションの開いているファイルディスクリプタを閉じます。 記述子 0、1、2 (つまり、stdin 、stdout 、stderr) および、lowestFileDescriptorToClose フィールドの値よりも小さい番号の記述子は、そのまま残されます。

上記の設定はすべて、QProcess::setChildProcessModifier() で設定されたハンドラから、それぞれの POSIX 関数を呼び出すことで手動で行うことも可能です。この構造により、QProcess はプラットフォーム固有の違いに対処し、特定の最適化の恩恵を受け、コードの重複を削減できます。さらに、これらの関数のいずれかが失敗した場合、QProcess はQProcess::FailedToStart 状態に入りますが、子プロセス修飾子のコールバックが失敗することは許されません。

QProcess::setUnixProcessParameters() およびQProcess::setChildProcessModifier()も参照してください 。

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