Sophie

Sophie

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

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" />
<!-- qdbusinterface.cpp -->
  <title>QDBusInterface 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 >QDBusInterface</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">QDBusInterface Class</h1>
<!-- $$$QDBusInterface-brief -->
<p>The <a href="qdbusinterface.html">QDBusInterface</a> class is a proxy for interfaces on remote objects. <a href="#details">More...</a></p>
<!-- @@@QDBusInterface -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QDBusInterface&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><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qdbusabstractinterface.html">QDBusAbstractInterface</a></td></tr></table></div><ul>
<li><a href="qdbusinterface-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="qdbusinterface.html#QDBusInterface">QDBusInterface</a></b>(const QString &amp;<i>service</i>, const QString &amp;<i>path</i>, const QString &amp;<i>interface</i> = QString(), const QDBusConnection &amp;<i>connection</i> = QDBusConnection::sessionBus(), QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusinterface.html#dtor.QDBusInterface">~QDBusInterface</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">15 public functions inherited from <a href="qdbusabstractinterface.html#public-functions">QDBusAbstractInterface</a></li>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QDBusInterface-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qdbusinterface.html">QDBusInterface</a> class is a proxy for interfaces on remote objects.</p>
<p><a href="qdbusinterface.html">QDBusInterface</a> is a generic accessor class that is used to place calls to remote objects, connect to signals exported by remote objects and get/set the value of remote properties. This class is useful for dynamic access to remote objects: that is, when you do not have a generated code that represents the remote interface.</p>
<p>Calls are usually placed by using the <a href="qdbusabstractinterface.html#call">call</a>() function, which constructs the message, sends it over the bus, waits for the reply and decodes the reply. Signals are connected to by using the normal <a href="../qtcore/qobject.html#connect-4">QObject::connect</a>() function. Finally, properties are accessed using the <a href="../qtcore/qobject.html#property">QObject::property</a>() and <a href="../qtcore/qobject.html#setProperty">QObject::setProperty</a>() functions.</p>
<p>The following code snippet demonstrates how to perform a mathematical operation of <code>&quot;2 + 2&quot;</code> in a remote application called <code>com.example.Calculator</code>, accessed via the session bus.</p>
<pre class="cpp">

  <span class="type"><a href="qdbusinterface.html#QDBusInterface">QDBusInterface</a></span> remoteApp( <span class="string">&quot;com.example.Calculator&quot;</span><span class="operator">,</span> <span class="string">&quot;/Calculator/Operations&quot;</span><span class="operator">,</span>
                            <span class="string">&quot;org.mathematics.RPNCalculator&quot;</span> );
  remoteApp<span class="operator">.</span>call( <span class="string">&quot;PushOperand&quot;</span><span class="operator">,</span> <span class="number">2</span> );
  remoteApp<span class="operator">.</span>call( <span class="string">&quot;PushOperand&quot;</span><span class="operator">,</span> <span class="number">2</span> );
  remoteApp<span class="operator">.</span>call( <span class="string">&quot;ExecuteOperation&quot;</span><span class="operator">,</span> <span class="string">&quot;+&quot;</span> );
  <span class="type"><a href="qdbusreply.html">QDBusReply</a></span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span> reply <span class="operator">=</span> remoteApp<span class="operator">.</span>call( <span class="string">&quot;PopOperand&quot;</span> );

  <span class="keyword">if</span> ( reply<span class="operator">.</span>isValid() )
      printf( <span class="string">&quot;%d&quot;</span><span class="operator">,</span> reply<span class="operator">.</span>value() );          <span class="comment">// prints 4</span>

</pre>
</div>
<p><b>See also </b><a href="qdbusxml2cpp.html">Qt D-Bus XML compiler (qdbusxml2cpp)</a>.</p>
<!-- @@@QDBusInterface -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDBusInterface[overload1]$$$QDBusInterfaceconstQString&constQString&constQString&constQDBusConnection&QObject* -->
<h3 class="fn" id="QDBusInterface"><a name="QDBusInterface"></a>QDBusInterface::<span class="name">QDBusInterface</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>service</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>path</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>interface</i> = QString(), const <span class="type"><a href="qdbusconnection.html">QDBusConnection</a></span> &amp;<i>connection</i> = QDBusConnection::sessionBus(), <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Creates a dynamic <a href="qdbusinterface.html">QDBusInterface</a> object associated with the interface <i>interface</i> on object at path <i>path</i> on service <i>service</i>, using the given <i>connection</i>. If <i>interface</i> is an empty string, the object created will refer to the merging of all interfaces found in that object.</p>
<p><i>parent</i> is passed to the base class constructor.</p>
<p>If the remote service <i>service</i> is not present or if an error occurs trying to obtain the description of the remote interface <i>interface</i>, the object created will not be valid (see <a href="qdbusabstractinterface.html#isValid">isValid</a>()).</p>
<!-- @@@QDBusInterface -->
<!-- $$$~QDBusInterface[overload1]$$$~QDBusInterface -->
<h3 class="fn" id="dtor.QDBusInterface"><a name="dtor.QDBusInterface"></a>QDBusInterface::<span class="name">~QDBusInterface</span>()</h3>
<p>Destroy the object interface and frees up any resource used.</p>
<!-- @@@~QDBusInterface -->
</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>