Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 641

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?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>QProcessEnvironment Class | Qt Core 5.12.6</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 >QProcessEnvironment</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtcore-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QProcessEnvironment Class</h1>
<!-- $$$QProcessEnvironment-brief -->
<p>The <a href="qprocessenvironment.html">QProcessEnvironment</a> class holds the environment variables that can be passed to a program. <a href="#details">More...</a></p>
<!-- @@@QProcessEnvironment -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QProcessEnvironment&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += core</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.6</td></tr></table></div><ul>
<li><a href="qprocessenvironment-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are reentrant.</p>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#QProcessEnvironment-1">QProcessEnvironment</a></b>(const QProcessEnvironment &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#dtor.QProcessEnvironment">~QProcessEnvironment</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#contains">contains</a></b>(const QString &amp;<i>name</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#insert">insert</a></b>(const QString &amp;<i>name</i>, const QString &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#insert-1">insert</a></b>(const QProcessEnvironment &amp;<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#isEmpty">isEmpty</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#keys">keys</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#remove">remove</a></b>(const QString &amp;<i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#swap">swap</a></b>(QProcessEnvironment &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#toStringList">toStringList</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#value">value</a></b>(const QString &amp;<i>name</i>, const QString &amp;<i>defaultValue</i> = QString()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#operator-not-eq">operator!=</a></b>(const QProcessEnvironment &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QProcessEnvironment &amp;</td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#operator-eq">operator=</a></b>(QProcessEnvironment &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QProcessEnvironment &amp;</td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#operator-eq-1">operator=</a></b>(const QProcessEnvironment &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#operator-eq-eq">operator==</a></b>(const QProcessEnvironment &amp;<i>other</i>) const</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QProcessEnvironment </td><td class="memItemRight bottomAlign"><b><a href="qprocessenvironment.html#systemEnvironment">systemEnvironment</a></b>()</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QProcessEnvironment-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qprocessenvironment.html">QProcessEnvironment</a> class holds the environment variables that can be passed to a program.</p>
<p>A process's environment is composed of a set of key=value pairs known as environment variables. The <a href="qprocessenvironment.html">QProcessEnvironment</a> class wraps that concept and allows easy manipulation of those variables. It's meant to be used along with <a href="qprocess.html">QProcess</a>, to set the environment for child processes. It cannot be used to change the current process's environment.</p>
<p>The environment of the calling process can be obtained using <a href="qprocessenvironment.html#systemEnvironment">QProcessEnvironment::systemEnvironment</a>().</p>
<p>On Unix systems, the variable names are case-sensitive. Note that the Unix environment allows both variable names and contents to contain arbitrary binary data (except for the NUL character). <a href="qprocessenvironment.html">QProcessEnvironment</a> will preserve such variables, but does not support manipulating variables whose names or values cannot be encoded by the current locale settings (see <a href="qtextcodec.html#codecForLocale">QTextCodec::codecForLocale</a>).</p>
<p>On Windows, the variable names are case-insensitive, but case-preserving. <a href="qprocessenvironment.html">QProcessEnvironment</a> behaves accordingly.</p>
</div>
<p><b>See also </b><a href="qprocess.html">QProcess</a>, <a href="qprocess.html#systemEnvironment">QProcess::systemEnvironment</a>(), and <a href="qprocess.html#setProcessEnvironment">QProcess::setProcessEnvironment</a>().</p>
<!-- @@@QProcessEnvironment -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QProcessEnvironment[overload1]$$$QProcessEnvironment -->
<h3 class="fn" id="QProcessEnvironment"><a name="QProcessEnvironment"></a>QProcessEnvironment::<span class="name">QProcessEnvironment</span>()</h3>
<p>Creates a new <a href="qprocessenvironment.html">QProcessEnvironment</a> object. This constructor creates an empty environment. If set on a <a href="qprocess.html">QProcess</a>, this will cause the current environment variables to be removed.</p>
<!-- @@@QProcessEnvironment -->
<!-- $$$QProcessEnvironment$$$QProcessEnvironmentconstQProcessEnvironment& -->
<h3 class="fn" id="QProcessEnvironment-1"><a name="QProcessEnvironment-1"></a>QProcessEnvironment::<span class="name">QProcessEnvironment</span>(const <span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;<i>other</i>)</h3>
<p>Creates a <a href="qprocessenvironment.html">QProcessEnvironment</a> object that is a copy of <i>other</i>.</p>
<!-- @@@QProcessEnvironment -->
<!-- $$$~QProcessEnvironment[overload1]$$$~QProcessEnvironment -->
<h3 class="fn" id="dtor.QProcessEnvironment"><a name="dtor.QProcessEnvironment"></a>QProcessEnvironment::<span class="name">~QProcessEnvironment</span>()</h3>
<p>Frees the resources associated with this <a href="qprocessenvironment.html">QProcessEnvironment</a> object.</p>
<!-- @@@~QProcessEnvironment -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><span class="type">void</span> QProcessEnvironment::<span class="name">clear</span>()</h3>
<p>Removes all key=value pairs from this <a href="qprocessenvironment.html">QProcessEnvironment</a> object, making it empty.</p>
<p><b>See also </b><a href="qprocessenvironment.html#isEmpty">isEmpty</a>() and <a href="qprocessenvironment.html#systemEnvironment">systemEnvironment</a>().</p>
<!-- @@@clear -->
<!-- $$$contains[overload1]$$$containsconstQString& -->
<h3 class="fn" id="contains"><a name="contains"></a><span class="type">bool</span> QProcessEnvironment::<span class="name">contains</span>(const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>name</i>) const</h3>
<p>Returns <code>true</code> if the environment variable of name <i>name</i> is found in this <a href="qprocessenvironment.html">QProcessEnvironment</a> object.</p>
<p><b>See also </b><a href="qprocessenvironment.html#insert">insert</a>() and <a href="qprocessenvironment.html#value">value</a>().</p>
<!-- @@@contains -->
<!-- $$$insert[overload1]$$$insertconstQString&constQString& -->
<h3 class="fn" id="insert"><a name="insert"></a><span class="type">void</span> QProcessEnvironment::<span class="name">insert</span>(const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>name</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>value</i>)</h3>
<p>Inserts the environment variable of name <i>name</i> and contents <i>value</i> into this <a href="qprocessenvironment.html">QProcessEnvironment</a> object. If that variable already existed, it is replaced by the new value.</p>
<p>On most systems, inserting a variable with no contents will have the same effect for applications as if the variable had not been set at all. However, to guarantee that there are no incompatibilities, to remove a variable, please use the <a href="qprocessenvironment.html#remove">remove</a>() function.</p>
<p><b>See also </b><a href="qprocessenvironment.html#contains">contains</a>(), <a href="qprocessenvironment.html#remove">remove</a>(), and <a href="qprocessenvironment.html#value">value</a>().</p>
<!-- @@@insert -->
<!-- $$$insert$$$insertconstQProcessEnvironment& -->
<h3 class="fn" id="insert-1"><a name="insert-1"></a><span class="type">void</span> QProcessEnvironment::<span class="name">insert</span>(const <span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;<i>e</i>)</h3>
<p>This is an overloaded function.</p>
<p>Inserts the contents of <i>e</i> in this <a href="qprocessenvironment.html">QProcessEnvironment</a> object. Variables in this object that also exist in <i>e</i> will be overwritten.</p>
<p>This function was introduced in  Qt 4.8.</p>
<!-- @@@insert -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn" id="isEmpty"><a name="isEmpty"></a><span class="type">bool</span> QProcessEnvironment::<span class="name">isEmpty</span>() const</h3>
<p>Returns <code>true</code> if this <a href="qprocessenvironment.html">QProcessEnvironment</a> object is empty: that is there are no key=value pairs set.</p>
<p><b>See also </b><a href="qprocessenvironment.html#clear">clear</a>(), <a href="qprocessenvironment.html#systemEnvironment">systemEnvironment</a>(), and <a href="qprocessenvironment.html#insert">insert</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$keys[overload1]$$$keys -->
<h3 class="fn" id="keys"><a name="keys"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QProcessEnvironment::<span class="name">keys</span>() const</h3>
<p>Returns a list containing all the variable names in this <a href="qprocessenvironment.html">QProcessEnvironment</a> object.</p>
<p>This function was introduced in  Qt 4.8.</p>
<!-- @@@keys -->
<!-- $$$remove[overload1]$$$removeconstQString& -->
<h3 class="fn" id="remove"><a name="remove"></a><span class="type">void</span> QProcessEnvironment::<span class="name">remove</span>(const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>name</i>)</h3>
<p>Removes the environment variable identified by <i>name</i> from this <a href="qprocessenvironment.html">QProcessEnvironment</a> object. If that variable did not exist before, nothing happens.</p>
<p><b>See also </b><a href="qprocessenvironment.html#contains">contains</a>(), <a href="qprocessenvironment.html#insert">insert</a>(), and <a href="qprocessenvironment.html#value">value</a>().</p>
<!-- @@@remove -->
<!-- $$$swap[overload1]$$$swapQProcessEnvironment& -->
<h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QProcessEnvironment::<span class="name">swap</span>(<span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;<i>other</i>)</h3>
<p>Swaps this process environment instance with <i>other</i>. This function is very fast and never fails.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@swap -->
<!-- $$$systemEnvironment[overload1]$$$systemEnvironment -->
<h3 class="fn" id="systemEnvironment"><a name="systemEnvironment"></a><code>[static] </code><span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> QProcessEnvironment::<span class="name">systemEnvironment</span>()</h3>
<p>The systemEnvironment function returns the environment of the calling process.</p>
<p>It is returned as a <a href="qprocessenvironment.html">QProcessEnvironment</a>. This function does not cache the system environment. Therefore, it's possible to obtain an updated version of the environment if low-level C library functions like <code>setenv</code> or <code>putenv</code> have been called.</p>
<p>However, note that repeated calls to this function will recreate the <a href="qprocessenvironment.html">QProcessEnvironment</a> object, which is a non-trivial operation.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qprocess.html#systemEnvironment">QProcess::systemEnvironment</a>().</p>
<!-- @@@systemEnvironment -->
<!-- $$$toStringList[overload1]$$$toStringList -->
<h3 class="fn" id="toStringList"><a name="toStringList"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QProcessEnvironment::<span class="name">toStringList</span>() const</h3>
<p>Converts this <a href="qprocessenvironment.html">QProcessEnvironment</a> object into a list of strings, one for each environment variable that is set. The environment variable's name and its value are separated by an equal character ('=').</p>
<p>The <a href="qstringlist.html">QStringList</a> contents returned by this function are suitable for presentation. Use with the QProcess::setEnvironment function is not recommended due to potential encoding problems under Unix, and worse performance.</p>
<p><b>See also </b><a href="qprocessenvironment.html#systemEnvironment">systemEnvironment</a>(), <a href="qprocess.html#systemEnvironment">QProcess::systemEnvironment</a>(), and <a href="qprocess.html#setProcessEnvironment">QProcess::setProcessEnvironment</a>().</p>
<!-- @@@toStringList -->
<!-- $$$value[overload1]$$$valueconstQString&constQString& -->
<h3 class="fn" id="value"><a name="value"></a><span class="type"><a href="qstring.html">QString</a></span> QProcessEnvironment::<span class="name">value</span>(const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>name</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp;<i>defaultValue</i> = QString()) const</h3>
<p>Searches this <a href="qprocessenvironment.html">QProcessEnvironment</a> object for a variable identified by <i>name</i> and returns its value. If the variable is not found in this object, then <i>defaultValue</i> is returned instead.</p>
<p><b>See also </b><a href="qprocessenvironment.html#contains">contains</a>(), <a href="qprocessenvironment.html#insert">insert</a>(), and <a href="qprocessenvironment.html#remove">remove</a>().</p>
<!-- @@@value -->
<!-- $$$operator!=[overload1]$$$operator!=constQProcessEnvironment& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QProcessEnvironment::<span class="name">operator!=</span>(const <span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this and the <i>other</i> <a href="qprocessenvironment.html">QProcessEnvironment</a> objects are different.</p>
<p><b>See also </b><a href="qprocessenvironment.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=QProcessEnvironment&& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;QProcessEnvironment::<span class="name">operator=</span>(<span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assignment operator.</p><!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQProcessEnvironment& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;QProcessEnvironment::<span class="name">operator=</span>(const <span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;<i>other</i>)</h3>
<p>Copies the contents of the <i>other</i> <a href="qprocessenvironment.html">QProcessEnvironment</a> object into this one.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQProcessEnvironment& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QProcessEnvironment::<span class="name">operator==</span>(const <span class="type"><a href="qprocessenvironment.html#QProcessEnvironment">QProcessEnvironment</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this and the <i>other</i> <a href="qprocessenvironment.html">QProcessEnvironment</a> objects are equal.</p>
<p>Two <a href="qprocessenvironment.html">QProcessEnvironment</a> objects are considered equal if they have the same set of key=value pairs. The comparison of keys is done case-sensitive on platforms where the environment is case-sensitive.</p>
<p><b>See also </b><a href="qprocessenvironment.html#operator-not-eq">operator!=</a>() and <a href="qprocessenvironment.html#contains">contains</a>().</p>
<!-- @@@operator== -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</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>