Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 955

qtbase5-doc-5.9.4-1.1.mga6.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" />
<!-- qdbusunixfiledescriptor.cpp -->
  <title>QDBusUnixFileDescriptor Class | Qt D-Bus</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.9</td><td ><a href="qtdbus-index.html">Qt D-Bus</a></td><td ><a href="qtdbus-module.html">C++ Classes</a></td><td >QDBusUnixFileDescriptor</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</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>
<li class="level2"><a href="#availability">Availability</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QDBusUnixFileDescriptor Class</h1>
<!-- $$$QDBusUnixFileDescriptor-brief -->
<p>The <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> class holds one Unix file descriptor. <a href="#details">More...</a></p>
<!-- @@@QDBusUnixFileDescriptor -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QDBusUnixFileDescriptor&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += dbus</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.8</td></tr></table></div><ul>
<li><a href="qdbusunixfiledescriptor-members.html">List of all members, including inherited members</a></li>
</ul>
<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="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor">QDBusUnixFileDescriptor</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor-1">QDBusUnixFileDescriptor</a></b>(int <i>fileDescriptor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor-2">QDBusUnixFileDescriptor</a></b>(const QDBusUnixFileDescriptor &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#dtor.QDBusUnixFileDescriptor">~QDBusUnixFileDescriptor</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#isValid">isValid</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#setFileDescriptor">setFileDescriptor</a></b>(int <i>fileDescriptor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#swap">swap</a></b>(QDBusUnixFileDescriptor &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusUnixFileDescriptor &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#operator-eq">operator=</a></b>(QDBusUnixFileDescriptor &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusUnixFileDescriptor &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#operator-eq-1">operator=</a></b>(const QDBusUnixFileDescriptor &amp;<i>other</i>)</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"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdbusunixfiledescriptor.html#isSupported">isSupported</a></b>()</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QDBusUnixFileDescriptor-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> class holds one Unix file descriptor.</p>
<p>The <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> class is used to hold one Unix file descriptor for use with the Qt D-Bus module. This allows applications to send and receive Unix file descriptors over the D-Bus connection, mapping automatically to the D-Bus type 'h'.</p>
<p>Objects of type QDBusUnixFileDescriptors can be used also as parameters in signals and slots that get exported to D-Bus by registering with <a href="qdbusconnection.html#registerObject">QDBusConnection::registerObject</a>.</p>
<p><a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> does not take ownership of the file descriptor. Instead, it will use the Unix system call <code>dup(2)</code> to make a copy of the file descriptor. This file descriptor belongs to the <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object and should not be stored or closed by the user. Instead, you should make your own copy if you need that.</p>
<a name="availability"></a>
<h4 >Availability</h4>
<p>Unix file descriptor passing is not available in all D-Bus connections. This feature is present with D-Bus library and bus daemon version 1.4 and upwards on Unix systems. Qt D-Bus automatically enables the feature if such a version was found at compile-time and run-time.</p>
<p>To verify that your connection does support passing file descriptors, check if the <a href="qdbusconnection.html#ConnectionCapability-enum">QDBusConnection::UnixFileDescriptorPassing</a> capability is set with <a href="qdbusconnection.html#connectionCapabilities">QDBusConnection::connectionCapabilities</a>(). If the flag is not active, then you will not be able to make calls to methods that have <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> as arguments or even embed such a type in a variant. You will also not receive calls containing that type.</p>
<p>Note also that remote applications may not have support for Unix file descriptor passing. If you make a D-Bus to a remote application that cannot receive such a type, you will receive an error reply. If you try to send a signal containing a D-Bus file descriptor or return one from a method call, the message will be silently dropped.</p>
<p>Even if the feature is not available, <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> will continue to operate, so code need not have compile-time checks for the availability of this feature.</p>
<p>On non-Unix systems, <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> will always report an invalid state and <a href="qdbusunixfiledescriptor.html#isSupported">QDBusUnixFileDescriptor::isSupported</a>() will return false.</p>
</div>
<p><b>See also </b><a href="qdbusconnection.html#ConnectionCapability-enum">QDBusConnection::ConnectionCapabilities</a> and <a href="qdbusconnection.html#connectionCapabilities">QDBusConnection::connectionCapabilities</a>().</p>
<!-- @@@QDBusUnixFileDescriptor -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDBusUnixFileDescriptor[overload1]$$$QDBusUnixFileDescriptor -->
<h3 class="fn" id="QDBusUnixFileDescriptor"><a name="QDBusUnixFileDescriptor"></a>QDBusUnixFileDescriptor::<span class="name">QDBusUnixFileDescriptor</span>()</h3>
<p>Constructs a <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> without a wrapped file descriptor. This is equivalent to constructing the object with an invalid file descriptor (like -1).</p>
<p><b>See also </b><a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>() and <a href="qdbusunixfiledescriptor.html#isValid">isValid</a>().</p>
<!-- @@@QDBusUnixFileDescriptor -->
<!-- $$$QDBusUnixFileDescriptor$$$QDBusUnixFileDescriptorint -->
<h3 class="fn" id="QDBusUnixFileDescriptor-1"><a name="QDBusUnixFileDescriptor-1"></a>QDBusUnixFileDescriptor::<span class="name">QDBusUnixFileDescriptor</span>(<span class="type">int</span> <i>fileDescriptor</i>)</h3>
<p>Constructs a <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object by copying the <i>fileDescriptor</i> parameter. The original file descriptor is not touched and must be closed by the user.</p>
<p>Note that the value returned by <a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>() will be different from the <i>fileDescriptor</i> parameter passed.</p>
<p>If the <i>fileDescriptor</i> parameter is not valid, <a href="qdbusunixfiledescriptor.html#isValid">isValid</a>() will return false and <a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>() will return -1.</p>
<p><b>See also </b><a href="qdbusunixfiledescriptor.html#setFileDescriptor">setFileDescriptor</a>() and <a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>().</p>
<!-- @@@QDBusUnixFileDescriptor -->
<!-- $$$QDBusUnixFileDescriptor$$$QDBusUnixFileDescriptorconstQDBusUnixFileDescriptor& -->
<h3 class="fn" id="QDBusUnixFileDescriptor-2"><a name="QDBusUnixFileDescriptor-2"></a>QDBusUnixFileDescriptor::<span class="name">QDBusUnixFileDescriptor</span>(const <span class="type"><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor">QDBusUnixFileDescriptor</a></span> &amp;<i>other</i>)</h3>
<p>Constructs a <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object by copying <i>other</i>.</p>
<!-- @@@QDBusUnixFileDescriptor -->
<!-- $$$~QDBusUnixFileDescriptor[overload1]$$$~QDBusUnixFileDescriptor -->
<h3 class="fn" id="dtor.QDBusUnixFileDescriptor"><a name="dtor.QDBusUnixFileDescriptor"></a>QDBusUnixFileDescriptor::<span class="name">~QDBusUnixFileDescriptor</span>()</h3>
<p>Destroys this <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object and disposes of the Unix file descriptor that it contained.</p>
<!-- @@@~QDBusUnixFileDescriptor -->
<!-- $$$fileDescriptor[overload1]$$$fileDescriptor -->
<h3 class="fn" id="fileDescriptor"><a name="fileDescriptor"></a><span class="type">int</span> QDBusUnixFileDescriptor::<span class="name">fileDescriptor</span>() const</h3>
<p>Returns the Unix file descriptor contained by this <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object. An invalid file descriptor is represented by the value -1.</p>
<p>Note that the file descriptor returned by this function is owned by the <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object and must not be stored past the lifetime of this object. It is ok to use it while this object is valid, but if one wants to store it for longer use, the file descriptor should be cloned using the Unix <code>dup(2)</code>, <code>dup2(2)</code> or <code>dup3(2)</code> functions.</p>
<p><b>See also </b><a href="qdbusunixfiledescriptor.html#setFileDescriptor">setFileDescriptor</a>() and <a href="qdbusunixfiledescriptor.html#isValid">isValid</a>().</p>
<!-- @@@fileDescriptor -->
<!-- $$$isSupported[overload1]$$$isSupported -->
<h3 class="fn" id="isSupported"><a name="isSupported"></a><code>[static] </code><span class="type">bool</span> QDBusUnixFileDescriptor::<span class="name">isSupported</span>()</h3>
<p>Returns <code>true</code> if Unix file descriptors are supported on this platform. In other words, this function returns <code>true</code> if this is a Unix platform.</p>
<p>Note that <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> continues to operate even if this function returns <code>false</code>. The only difference is that the <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> objects will always be in the <a href="qdbusunixfiledescriptor.html#isValid">isValid</a>() == false state and <a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>() will always return -1. The class will not consume any operating system resources.</p>
<!-- @@@isSupported -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn" id="isValid"><a name="isValid"></a><span class="type">bool</span> QDBusUnixFileDescriptor::<span class="name">isValid</span>() const</h3>
<p>Returns <code>true</code> if this Unix file descriptor is valid. A valid Unix file descriptor is not -1.</p>
<p><b>See also </b><a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>().</p>
<!-- @@@isValid -->
<!-- $$$setFileDescriptor[overload1]$$$setFileDescriptorint -->
<h3 class="fn" id="setFileDescriptor"><a name="setFileDescriptor"></a><span class="type">void</span> QDBusUnixFileDescriptor::<span class="name">setFileDescriptor</span>(<span class="type">int</span> <i>fileDescriptor</i>)</h3>
<p>Sets the file descriptor that this <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object holds to a copy of <i>fileDescriptor</i>. The original file descriptor is not touched and must be closed by the user.</p>
<p>Note that the value returned by <a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>() will be different from the <i>fileDescriptor</i> parameter passed.</p>
<p>If the <i>fileDescriptor</i> parameter is not valid, <a href="qdbusunixfiledescriptor.html#isValid">isValid</a>() will return false and <a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>() will return -1.</p>
<p><b>See also </b><a href="qdbusunixfiledescriptor.html#isValid">isValid</a>() and <a href="qdbusunixfiledescriptor.html#fileDescriptor">fileDescriptor</a>().</p>
<!-- @@@setFileDescriptor -->
<!-- $$$swap[overload1]$$$swapQDBusUnixFileDescriptor& -->
<h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QDBusUnixFileDescriptor::<span class="name">swap</span>(<span class="type"><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor">QDBusUnixFileDescriptor</a></span> &amp;<i>other</i>)</h3>
<p>Swaps this file descriptor 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 -->
<!-- $$$operator=[overload1]$$$operator=QDBusUnixFileDescriptor&& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor">QDBusUnixFileDescriptor</a></span> &amp;QDBusUnixFileDescriptor::<span class="name">operator=</span>(<span class="type"><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor">QDBusUnixFileDescriptor</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assigns <i>other</i> to this <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a>.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQDBusUnixFileDescriptor& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor">QDBusUnixFileDescriptor</a></span> &amp;QDBusUnixFileDescriptor::<span class="name">operator=</span>(const <span class="type"><a href="qdbusunixfiledescriptor.html#QDBusUnixFileDescriptor">QDBusUnixFileDescriptor</a></span> &amp;<i>other</i>)</h3>
<p>Copies the Unix file descriptor from the <i>other</i> <a href="qdbusunixfiledescriptor.html">QDBusUnixFileDescriptor</a> object. If the current object contained a file descriptor, it will be properly disposed of before.</p>
<!-- @@@operator= -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 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>