<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qprocess.cpp --> <title>Obsolete Members for QProcess | Qt Core 5.12.2</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtcore-index.html">Qt Core</a></td><td ><a href="qtcore-module.html">C++ Classes</a></td><td >QProcess</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtcore-index.html">Qt 5.12.2 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Obsolete Members for QProcess</h1> <p><b>The following members of class <a href="qprocess.html">QProcess</a> are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p> <h2>Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#dumpObjectInfo-1">dumpObjectInfo</a></b>()</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#dumpObjectTree-1">dumpObjectTree</a></b>()</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QStringList </td><td class="memItemRight bottomAlign"><b><a href="qprocess-obsolete.html#environment">environment</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>Q_PID </td><td class="memItemRight bottomAlign"><b><a href="qprocess-obsolete.html#pid">pid</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QProcess::ProcessChannelMode </td><td class="memItemRight bottomAlign"><b><a href="qprocess-obsolete.html#readChannelMode">readChannelMode</a></b>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qprocess-obsolete.html#setEnvironment">setEnvironment</a></b>(const QStringList &<i>environment</i>)</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qprocess-obsolete.html#setReadChannelMode">setReadChannelMode</a></b>(QProcess::ProcessChannelMode <i>mode</i>)</td></tr> </table></div> <h2>Signals</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qprocess-obsolete.html#error-1">error</a></b>(QProcess::ProcessError <i>error</i>)</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qprocess-obsolete.html#finished-1">finished</a></b>(int <i>exitCode</i>)</td></tr> </table></div> <h2>Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QString </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#trUtf8">trUtf8</a></b>(const char *<i>sourceText</i>, const char *<i>disambiguation</i> = Q_OBJECT, int <i>n</i> = Q_OBJECT)</td></tr> </table></div> <h2>Member Function Documentation</h2> <!-- $$$environment[overload1]$$$environment --> <h3 class="fn" id="environment"><a name="environment"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QProcess::<span class="name">environment</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the environment that <a href="qprocess.html">QProcess</a> will pass to its child process, or an empty <a href="qstringlist.html">QStringList</a> if no environment has been set using <a href="qprocess-obsolete.html#setEnvironment">setEnvironment</a>(). If no environment has been set, the environment of the calling process will be used.</p> <p><b>See also </b><a href="qprocess.html#processEnvironment">processEnvironment</a>(), <a href="qprocess-obsolete.html#setEnvironment">setEnvironment</a>(), and <a href="qprocess.html#systemEnvironment">systemEnvironment</a>().</p> <!-- @@@environment --> <!-- $$$error$$$errorQProcess::ProcessError --> <h3 class="fn" id="error-1"><a name="error-1"></a><code>[signal] </code><span class="type">void</span> QProcess::<span class="name">error</span>(<span class="type"><a href="qprocess.html#ProcessError-enum">QProcess::ProcessError</a></span> <i>error</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Use <a href="qprocess.html#errorOccurred">errorOccurred</a>() instead.</p> <p><b>Note:</b> Signal <i>error</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp"> connect(process<span class="operator">,</span> <span class="type">QOverload</span><span class="operator"><</span><span class="type"><a href="qprocess.html#QProcess">QProcess</a></span><span class="operator">::</span>ProcessError<span class="operator">></span><span class="operator">::</span>of(<span class="operator">&</span><span class="type"><a href="qprocess.html#QProcess">QProcess</a></span><span class="operator">::</span>error)<span class="operator">,</span> <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type"><a href="qprocess.html#QProcess">QProcess</a></span><span class="operator">::</span>ProcessError error){ <span class="comment">/* ... */</span> }); </pre> <!-- @@@error --> <!-- $$$finished$$$finishedint --> <h3 class="fn" id="finished-1"><a name="finished-1"></a><code>[signal] </code><span class="type">void</span> QProcess::<span class="name">finished</span>(<span class="type">int</span> <i>exitCode</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This is an overloaded function.</p> <p>Use finished(int <a href="qprocess.html#exitCode">exitCode</a>, <a href="qprocess.html#ExitStatus-enum">QProcess::ExitStatus</a> status) instead.</p> <p><b>Note:</b> Signal <i>finished</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp"> connect(process<span class="operator">,</span> <span class="type">QOverload</span><span class="operator"><</span><span class="type">int</span><span class="operator">></span><span class="operator">::</span>of(<span class="operator">&</span><span class="type"><a href="qprocess.html#QProcess">QProcess</a></span><span class="operator">::</span>finished)<span class="operator">,</span> <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type">int</span> exitCode){ <span class="comment">/* ... */</span> }); </pre> <!-- @@@finished --> <!-- $$$pid[overload1]$$$pid --> <h3 class="fn" id="pid"><a name="pid"></a><span class="type"><a href="qprocess.html#Q_PID-typedef">Q_PID</a></span> QProcess::<span class="name">pid</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Use <a href="qprocess.html#processId">processId</a>() instead.</p> <p>Returns the native process identifier for the running process, if available. If no process is currently running, <code>0</code> is returned.</p> <p><b>Note: </b>Unlike <a href="qprocess.html#processId">processId</a>(), pid() returns an integer on Unix and a pointer on Windows.</p><p><b>See also </b><a href="qprocess.html#Q_PID-typedef">Q_PID</a> and <a href="qprocess.html#processId">processId</a>().</p> <!-- @@@pid --> <!-- $$$readChannelMode[overload1]$$$readChannelMode --> <h3 class="fn" id="readChannelMode"><a name="readChannelMode"></a><span class="type"><a href="qprocess.html#ProcessChannelMode-enum">QProcess::ProcessChannelMode</a></span> QProcess::<span class="name">readChannelMode</span>() const</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns the read channel mode of the <a href="qprocess.html">QProcess</a>. This function is equivalent to <a href="qprocess.html#processChannelMode">processChannelMode</a>()</p> <p><b>See also </b><a href="qprocess-obsolete.html#setReadChannelMode">setReadChannelMode</a>() and <a href="qprocess.html#processChannelMode">processChannelMode</a>().</p> <!-- @@@readChannelMode --> <!-- $$$setEnvironment[overload1]$$$setEnvironmentconstQStringList& --> <h3 class="fn" id="setEnvironment"><a name="setEnvironment"></a><span class="type">void</span> QProcess::<span class="name">setEnvironment</span>(const <span class="type"><a href="qstringlist.html">QStringList</a></span> &<i>environment</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Sets the environment that <a href="qprocess.html">QProcess</a> will pass to the child process. The parameter <i>environment</i> is a list of key=value pairs.</p> <p>For example, the following code adds the environment variable <code>TMPDIR</code>:</p> <pre class="cpp"> <span class="type"><a href="qprocess.html#QProcess">QProcess</a></span> process; <span class="type"><a href="qstringlist.html">QStringList</a></span> env <span class="operator">=</span> <span class="type"><a href="qprocess.html#QProcess">QProcess</a></span><span class="operator">::</span>systemEnvironment(); env <span class="operator"><</span><span class="operator"><</span> <span class="string">"TMPDIR=C:\\MyApp\\temp"</span>; <span class="comment">// Add an environment variable</span> process<span class="operator">.</span>setEnvironment(env); process<span class="operator">.</span>start(<span class="string">"myapp"</span>); </pre> <p><b>Note: </b>This function is less efficient than the <a href="qprocess.html#setProcessEnvironment">setProcessEnvironment</a>() function.</p><p><b>See also </b><a href="qprocess-obsolete.html#environment">environment</a>(), <a href="qprocess.html#setProcessEnvironment">setProcessEnvironment</a>(), and <a href="qprocess.html#systemEnvironment">systemEnvironment</a>().</p> <!-- @@@setEnvironment --> <!-- $$$setReadChannelMode[overload1]$$$setReadChannelModeQProcess::ProcessChannelMode --> <h3 class="fn" id="setReadChannelMode"><a name="setReadChannelMode"></a><span class="type">void</span> QProcess::<span class="name">setReadChannelMode</span>(<span class="type"><a href="qprocess.html#ProcessChannelMode-enum">QProcess::ProcessChannelMode</a></span> <i>mode</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Use <a href="qprocess.html#setProcessChannelMode">setProcessChannelMode</a>(<i>mode</i>) instead.</p> <p><b>See also </b><a href="qprocess-obsolete.html#readChannelMode">readChannelMode</a>() and <a href="qprocess.html#setProcessChannelMode">setProcessChannelMode</a>().</p> <!-- @@@setReadChannelMode --> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> 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. </p> </div> </body> </html>