<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qdbuspendingcall.cpp --> <title>QDBusPendingCall 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.12</td><td ><a href="qtdbus-index.html">Qt D-Bus</a></td><td ><a href="qtdbus-module.html">C++ Classes</a></td><td >QDBusPendingCall</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtdbus-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="#protected-variables">Protected Variables</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">QDBusPendingCall Class</h1> <!-- $$$QDBusPendingCall-brief --> <p>The <a href="qdbuspendingcall.html">QDBusPendingCall</a> class refers to one pending asynchronous call. <a href="#details">More...</a></p> <!-- @@@QDBusPendingCall --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QDBusPendingCall></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.5</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qdbuspendingcallwatcher.html">QDBusPendingCallWatcher</a> and <a href="qdbuspendingreply.html">QDBusPendingReply</a></p> </td></tr></table></div><ul> <li><a href="qdbuspendingcall-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="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></b>(const QDBusPendingCall &<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbuspendingcall.html#dtor.QDBusPendingCall">~QDBusPendingCall</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbuspendingcall.html#swap">swap</a></b>(QDBusPendingCall &<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDBusPendingCall &</td><td class="memItemRight bottomAlign"><b><a href="qdbuspendingcall.html#operator-eq">operator=</a></b>(QDBusPendingCall &&<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDBusPendingCall &</td><td class="memItemRight bottomAlign"><b><a href="qdbuspendingcall.html#operator-eq-1">operator=</a></b>(const QDBusPendingCall &<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"> QDBusPendingCall </td><td class="memItemRight bottomAlign"><b><a href="qdbuspendingcall.html#fromCompletedCall">fromCompletedCall</a></b>(const QDBusMessage &<i>msg</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDBusPendingCall </td><td class="memItemRight bottomAlign"><b><a href="qdbuspendingcall.html#fromError">fromError</a></b>(const QDBusError &<i>error</i>)</td></tr> </table></div> <a name="protected-variables"></a> <h2 id="protected-variables">Protected Variables</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QExplicitlySharedDataPointer<QDBusPendingCallPrivate> </td><td class="memItemRight bottomAlign"><b><a href="qdbuspendingcall.html#d-var">d</a></b></td></tr> </table></div> <a name="details"></a> <!-- $$$QDBusPendingCall-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qdbuspendingcall.html">QDBusPendingCall</a> class refers to one pending asynchronous call.</p> <p>A <a href="qdbuspendingcall.html">QDBusPendingCall</a> object is a reference to a method call that was sent over D-Bus without waiting for a reply. <a href="qdbuspendingcall.html">QDBusPendingCall</a> is an opaque type, meant to be used as a handle for a pending reply.</p> <p>In most programs, the <a href="qdbuspendingcall.html">QDBusPendingCall</a> class will not be used directly. It can be safely replaced with the template-based <a href="qdbuspendingreply.html">QDBusPendingReply</a>, in order to access the contents of the reply or wait for it to be complete.</p> <p>The <a href="qdbuspendingcallwatcher.html">QDBusPendingCallWatcher</a> class allows one to connect to a signal that will indicate when the reply has arrived or if the call has timed out. It also provides the <a href="qdbuspendingcallwatcher.html#waitForFinished">QDBusPendingCallWatcher::waitForFinished</a>() method which will suspend the execution of the program until the reply has arrived.</p> <p><b>Note: </b>If you create a copy of a <a href="qdbuspendingcall.html">QDBusPendingCall</a> object, all information will be shared among the many copies. Therefore, <a href="qdbuspendingcall.html">QDBusPendingCall</a> is an explicitly-shared object and does not provide a method of detaching the copies (since they refer to the same pending call)</p></div> <p><b>See also </b><a href="qdbuspendingreply.html">QDBusPendingReply</a>, <a href="qdbuspendingcallwatcher.html">QDBusPendingCallWatcher</a>, and <a href="qdbusabstractinterface.html#asyncCall">QDBusAbstractInterface::asyncCall</a>().</p> <!-- @@@QDBusPendingCall --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QDBusPendingCall[overload1]$$$QDBusPendingCallconstQDBusPendingCall& --> <h3 class="fn" id="QDBusPendingCall"><a name="QDBusPendingCall"></a>QDBusPendingCall::<span class="name">QDBusPendingCall</span>(const <span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> &<i>other</i>)</h3> <p>Creates a copy of the <i>other</i> pending asynchronous call. Note that both objects will refer to the same pending call.</p> <!-- @@@QDBusPendingCall --> <!-- $$$~QDBusPendingCall[overload1]$$$~QDBusPendingCall --> <h3 class="fn" id="dtor.QDBusPendingCall"><a name="dtor.QDBusPendingCall"></a>QDBusPendingCall::<span class="name">~QDBusPendingCall</span>()</h3> <p>Destroys this copy of the <a href="qdbuspendingcall.html">QDBusPendingCall</a> object. If this copy is also the last copy of a pending asynchronous call, the call will be canceled and no further notifications will be received. There will be no way of accessing the reply's contents when it arrives.</p> <!-- @@@~QDBusPendingCall --> <!-- $$$fromCompletedCall[overload1]$$$fromCompletedCallconstQDBusMessage& --> <h3 class="fn" id="fromCompletedCall"><a name="fromCompletedCall"></a><code>[static] </code><span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> QDBusPendingCall::<span class="name">fromCompletedCall</span>(const <span class="type"><a href="qdbusmessage.html">QDBusMessage</a></span> &<i>msg</i>)</h3> <p>Creates a <a href="qdbuspendingcall.html">QDBusPendingCall</a> object based on the message <i>msg</i>. The message must be of type <a href="qdbusmessage.html#MessageType-enum">QDBusMessage::ErrorMessage</a> or <a href="qdbusmessage.html#MessageType-enum">QDBusMessage::ReplyMessage</a> (that is, a message that is typical of a completed call).</p> <p>This function is useful for code that requires simulating a pending call, but that has already finished.</p> <p>This function was introduced in Qt 4.6.</p> <p><b>See also </b><a href="qdbuspendingcall.html#fromError">fromError</a>().</p> <!-- @@@fromCompletedCall --> <!-- $$$fromError[overload1]$$$fromErrorconstQDBusError& --> <h3 class="fn" id="fromError"><a name="fromError"></a><code>[static] </code><span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> QDBusPendingCall::<span class="name">fromError</span>(const <span class="type"><a href="qdbuserror.html">QDBusError</a></span> &<i>error</i>)</h3> <p>Creates a <a href="qdbuspendingcall.html">QDBusPendingCall</a> object based on the error condition <i>error</i>. The resulting pending call object will be in the "finished" state and <a href="qdbuspendingreply.html#isError">QDBusPendingReply::isError</a>() will return true.</p> <p>This function was introduced in Qt 4.6.</p> <p><b>See also </b><a href="qdbuspendingcall.html#fromCompletedCall">fromCompletedCall</a>().</p> <!-- @@@fromError --> <!-- $$$swap[overload1]$$$swapQDBusPendingCall& --> <h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QDBusPendingCall::<span class="name">swap</span>(<span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> &<i>other</i>)</h3> <p>Swaps this pending call 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=QDBusPendingCall&& --> <h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> &QDBusPendingCall::<span class="name">operator=</span>(<span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> &&<i>other</i>)</h3> <p>Move-assignment operator.</p><!-- @@@operator= --> <!-- $$$operator=$$$operator=constQDBusPendingCall& --> <h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> &QDBusPendingCall::<span class="name">operator=</span>(const <span class="type"><a href="qdbuspendingcall.html#QDBusPendingCall">QDBusPendingCall</a></span> &<i>other</i>)</h3> <p>Creates a copy of the <i>other</i> pending asynchronous call and drops the reference to the previously-referenced call. Note that both objects will refer to the same pending call after this function.</p> <p>If this object contained the last reference of a pending asynchronous call, the call will be canceled and no further notifications will be received. There will be no way of accessing the reply's contents when it arrives.</p> <!-- @@@operator= --> </div> </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>