Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 5054

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdbusreply.cpp -->
  <title>Qt 4.8: QDBusReply Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtdbus.html">QtDBus</a></li>
<li>QDBusReply</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<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>
<h1 class="title">QDBusReply Class Reference</h1>
<!-- $$$QDBusReply-brief -->
<p>The QDBusReply class stores the reply for a method call to a remote object. <a href="#details">More...</a></p>
<!-- @@@QDBusReply -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDBusReply&gt;</span></pre><p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qdbusreply-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<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-2">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-3">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-4">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> ()</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-2">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-3">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-4">operator=</a></b> ( const QDBusReply &amp; <i>other</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QDBusReply-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDBusReply class stores the reply for a method call to a remote object.</p>
<p>A QDBusReply 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">QDBusReply</span><span class="operator">&lt;</span><span class="type"><a href="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="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>QDBusReply 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"><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"><a name="QDBusReply-2"></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"><a name="QDBusReply-3"></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"><a name="QDBusReply-4"></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"><a name="error"></a>const <span class="type"><a href="qdbuserror.html">QDBusError</a></span> &amp; QDBusReply::<span class="name">error</span> ()</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 -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QDBusReply::<span class="name">isValid</span> () const</h3>
<p>Returns true if no error occurred; otherwise, returns false.</p>
<p><b>See also </b><a href="qdbusreply.html#error">error</a>().</p>
<!-- @@@isValid -->
<!-- $$$value[overload1]$$$value -->
<h3 class="fn"><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 <tt>void</tt>.</p>
<!-- @@@value -->
<!-- $$$operator Type[overload1]$$$operator Type -->
<h3 class="fn"><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 <tt>void</tt>.</p>
<!-- @@@operator Type -->
<!-- $$$operator=[overload1]$$$operator=constQDBusMessage& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QDBusReply</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"><a name="operator-eq-2"></a><span class="type">QDBusReply</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"><a name="operator-eq-3"></a><span class="type">QDBusReply</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"><a name="operator-eq-4"></a><span class="type">QDBusReply</span> &amp; QDBusReply::<span class="name">operator=</span> ( const <span class="type">QDBusReply</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 class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>