Sophie

Sophie

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

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" />
<!-- qdbusreply.cpp -->
  <title>QDBusReply 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 >QDBusReply</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="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QDBusReply Class</h1>
<!-- $$$QDBusReply-brief -->
<p>The <a href="qdbusreply.html">QDBusReply</a> class stores the reply for a method call to a remote object. <a href="#details">More...</a></p>
<!-- @@@QDBusReply -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QDBusReply&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.2</td></tr></table></div><ul>
<li><a href="qdbusreply-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="qdbusreply.html#QDBusReply">QDBusReply</a></b>(const QDBusMessage &amp;<i>reply</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#QDBusReply-1">QDBusReply</a></b>(const QDBusPendingCall &amp;<i>pcall</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#QDBusReply-2">QDBusReply</a></b>(const QDBusPendingReply&lt;T&gt; &amp;<i>reply</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#QDBusReply-3">QDBusReply</a></b>(const QDBusError &amp;<i>error</i> = QDBusError())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusError &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#error">error</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusError &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#error-1">error</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#isValid">isValid</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Type </td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#value">value</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#operator-Type">operator Type</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusReply &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#operator-eq">operator=</a></b>(const QDBusMessage &amp;<i>message</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusReply &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#operator-eq-1">operator=</a></b>(const QDBusPendingCall &amp;<i>pcall</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusReply &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#operator-eq-2">operator=</a></b>(const QDBusError &amp;<i>error</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusReply &amp;</td><td class="memItemRight bottomAlign"><b><a href="qdbusreply.html#operator-eq-3">operator=</a></b>(const QDBusReply &amp;<i>other</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QDBusReply-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qdbusreply.html">QDBusReply</a> class stores the reply for a method call to a remote object.</p>
<p>A <a href="qdbusreply.html">QDBusReply</a> object is a subset of the <a href="qdbusmessage.html">QDBusMessage</a> object that represents a method call's reply. It contains only the first output argument or the error code and is used by <a href="qdbusinterface.html">QDBusInterface</a>-derived classes to allow returning the error code as the function's return argument.</p>
<p>It can be used in the following manner:</p>
<pre class="cpp">

  <span class="type"><a href="qdbusreply.html#QDBusReply">QDBusReply</a></span><span class="operator">&lt;</span><span class="type"><a href="../qtcore/qstring.html">QString</a></span><span class="operator">&gt;</span> reply <span class="operator">=</span> interface<span class="operator">-</span><span class="operator">&gt;</span>call(<span class="string">&quot;RemoteMethod&quot;</span>);
  <span class="keyword">if</span> (reply<span class="operator">.</span>isValid())
      <span class="comment">// use the returned value</span>
      useValue(reply<span class="operator">.</span>value());
  <span class="keyword">else</span>
      <span class="comment">// call failed. Show an error condition.</span>
      showError(reply<span class="operator">.</span>error());

</pre>
<p>If the remote method call cannot fail, you can skip the error checking:</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qstring.html">QString</a></span> reply <span class="operator">=</span> interface<span class="operator">-</span><span class="operator">&gt;</span>call(<span class="string">&quot;RemoteMethod&quot;</span>);

</pre>
<p>However, if it does fail under those conditions, the value returned by <a href="qdbusreply.html#value">QDBusReply::value</a>() is a default-constructed value. It may be indistinguishable from a valid return value.</p>
<p><a href="qdbusreply.html">QDBusReply</a> objects are used for remote calls that have no output arguments or return values (i.e&#x2e;, they have a &quot;void&quot; return type). Use the <a href="qdbusreply.html#isValid">isValid</a>() function to test if the reply succeeded.</p>
</div>
<p><b>See also </b><a href="qdbusmessage.html">QDBusMessage</a> and <a href="qdbusinterface.html">QDBusInterface</a>.</p>
<!-- @@@QDBusReply -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDBusReply[overload1]$$$QDBusReplyconstQDBusMessage& -->
<h3 class="fn" id="QDBusReply"><a name="QDBusReply"></a>QDBusReply::<span class="name">QDBusReply</span>(const <span class="type"><a href="qdbusmessage.html">QDBusMessage</a></span> &amp;<i>reply</i>)</h3>
<p>Automatically construct a <a href="qdbusreply.html">QDBusReply</a> object from the reply message <i>reply</i>, extracting the first return value from it if it is a success reply.</p>
<!-- @@@QDBusReply -->
<!-- $$$QDBusReply$$$QDBusReplyconstQDBusPendingCall& -->
<h3 class="fn" id="QDBusReply-1"><a name="QDBusReply-1"></a>QDBusReply::<span class="name">QDBusReply</span>(const <span class="type"><a href="qdbuspendingcall.html">QDBusPendingCall</a></span> &amp;<i>pcall</i>)</h3>
<p>Automatically construct a <a href="qdbusreply.html">QDBusReply</a> object from the asynchronous pending call <i>pcall</i>. If the call isn't finished yet, <a href="qdbusreply.html">QDBusReply</a> will call QDBusPendingCall::waitForFinished(), which is a blocking operation.</p>
<p>If the return types patch, <a href="qdbusreply.html">QDBusReply</a> will extract the first return argument from the reply.</p>
<!-- @@@QDBusReply -->
<!-- $$$QDBusReply$$$QDBusReplyconstQDBusPendingReply<T>& -->
<h3 class="fn" id="QDBusReply-2"><a name="QDBusReply-2"></a>QDBusReply::<span class="name">QDBusReply</span>(const <span class="type"><a href="qdbuspendingreply.html">QDBusPendingReply</a></span>&lt;<span class="type">T</span>&gt; &amp;<i>reply</i>)</h3>
<p>Constructs a <a href="qdbusreply.html">QDBusReply</a> object from the pending reply message, <i>reply</i>.</p>
<!-- @@@QDBusReply -->
<!-- $$$QDBusReply$$$QDBusReplyconstQDBusError& -->
<h3 class="fn" id="QDBusReply-3"><a name="QDBusReply-3"></a>QDBusReply::<span class="name">QDBusReply</span>(const <span class="type"><a href="qdbuserror.html">QDBusError</a></span> &amp;<i>error</i> = QDBusError())</h3>
<p>Constructs an error reply from the D-Bus error code given by <i>error</i>.</p>
<!-- @@@QDBusReply -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn" id="error"><a name="error"></a>const <span class="type"><a href="qdbuserror.html">QDBusError</a></span> &amp;QDBusReply::<span class="name">error</span>() const</h3>
<p>Returns the error code that was returned from the remote function call. If the remote call did not return an error (i.e&#x2e;, if it succeeded), then the <a href="qdbuserror.html">QDBusError</a> object that is returned will not be a valid error code (<a href="qdbuserror.html#isValid">QDBusError::isValid</a>() will return false).</p>
<p><b>See also </b><a href="qdbusreply.html#isValid">isValid</a>().</p>
<!-- @@@error -->
<!-- $$$error$$$error -->
<h3 class="fn" id="error-1"><a name="error-1"></a>const <span class="type"><a href="qdbuserror.html">QDBusError</a></span> &amp;QDBusReply::<span class="name">error</span>()</h3>
<p>This is an overloaded function.</p>
<!-- @@@error -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn" id="isValid"><a name="isValid"></a><span class="type">bool</span> QDBusReply::<span class="name">isValid</span>() const</h3>
<p>Returns <code>true</code> if no error occurred; otherwise, returns <code>false</code>.</p>
<p><b>See also </b><a href="qdbusreply.html#error">error</a>().</p>
<!-- @@@isValid -->
<!-- $$$value[overload1]$$$value -->
<h3 class="fn" id="value"><a name="value"></a><span class="type">Type</span> QDBusReply::<span class="name">value</span>() const</h3>
<p>Returns the remote function's calls return value. If the remote call returned with an error, the return value of this function is undefined and may be undistinguishable from a valid return value.</p>
<p>This function is not available if the remote call returns <code>void</code>.</p>
<!-- @@@value -->
<!-- $$$operator Type[overload1]$$$operator Type -->
<h3 class="fn" id="operator-Type"><a name="operator-Type"></a>QDBusReply::<span class="name">operator Type</span>() const</h3>
<p>Returns the same as <a href="qdbusreply.html#value">value</a>().</p>
<p>This function is not available if the remote call returns <code>void</code>.</p>
<!-- @@@operator Type -->
<!-- $$$operator=[overload1]$$$operator=constQDBusMessage& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qdbusreply.html#QDBusReply">QDBusReply</a></span> &amp;QDBusReply::<span class="name">operator=</span>(const <span class="type"><a href="qdbusmessage.html">QDBusMessage</a></span> &amp;<i>message</i>)</h3>
<p>Makes this object contain the reply specified by message <i>message</i>. If <i>message</i> is an error message, this function will copy the error code and message into this object</p>
<p>If <i>message</i> is a standard reply message and contains at least one parameter, it will be copied into this object, as long as it is of the correct type. If it's not of the same type as this <a href="qdbuserror.html">QDBusError</a> object, this function will instead set an error code indicating a type mismatch.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQDBusPendingCall& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qdbusreply.html#QDBusReply">QDBusReply</a></span> &amp;QDBusReply::<span class="name">operator=</span>(const <span class="type"><a href="qdbuspendingcall.html">QDBusPendingCall</a></span> &amp;<i>pcall</i>)</h3>
<p>Makes this object contain the reply specified by the pending asynchronous call <i>pcall</i>. If the call is not finished yet, this function will call QDBusPendingCall::waitForFinished() to block until the reply arrives.</p>
<p>If <i>pcall</i> finishes with an error message, this function will copy the error code and message into this object</p>
<p>If <i>pcall</i> finished with a standard reply message and contains at least one parameter, it will be copied into this object, as long as it is of the correct type. If it's not of the same type as this <a href="qdbuserror.html">QDBusError</a> object, this function will instead set an error code indicating a type mismatch.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQDBusError& -->
<h3 class="fn" id="operator-eq-2"><a name="operator-eq-2"></a><span class="type"><a href="qdbusreply.html#QDBusReply">QDBusReply</a></span> &amp;QDBusReply::<span class="name">operator=</span>(const <span class="type"><a href="qdbuserror.html">QDBusError</a></span> &amp;<i>error</i>)</h3>
<p>Sets this object to contain the error code given by <i>error</i>. You can later access it with <a href="qdbusreply.html#error">error</a>().</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQDBusReply& -->
<h3 class="fn" id="operator-eq-3"><a name="operator-eq-3"></a><span class="type"><a href="qdbusreply.html#QDBusReply">QDBusReply</a></span> &amp;QDBusReply::<span class="name">operator=</span>(const <span class="type"><a href="qdbusreply.html#QDBusReply">QDBusReply</a></span> &amp;<i>other</i>)</h3>
<p>Makes this object be a copy of the object <i>other</i>.</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>