<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qdbusabstractadaptor.cpp --> <title>QDBusAbstractAdaptor 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 >QDBusAbstractAdaptor</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-functions">Protected Functions</a></li> <li class="level1"><a href="#macros">Macros</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">QDBusAbstractAdaptor Class</h1> <!-- $$$QDBusAbstractAdaptor-brief --> <p>The <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> class is the base class of D-Bus adaptor classes. <a href="#details">More...</a></p> <!-- @@@QDBusAbstractAdaptor --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QDBusAbstractAdaptor></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="../qtcore/qobject.html">QObject</a></td></tr></table></div><ul> <li><a href="qdbusabstractadaptor-members.html">List of all members, including inherited members</a></li> <li><a href="qdbusabstractadaptor-obsolete.html">Obsolete 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"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qdbusabstractadaptor.html#dtor.QDBusAbstractAdaptor">~QDBusAbstractAdaptor</a></b>()</td></tr> </table></div> <ul> <li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li> </ul> <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"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qdbusabstractadaptor.html#staticMetaObject-var">staticMetaObject</a></b></td></tr> </table></div> <ul> <li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li> </ul> <a name="protected-functions"></a> <h2 id="protected-functions">Protected Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusabstractadaptor.html#QDBusAbstractAdaptor">QDBusAbstractAdaptor</a></b>(QObject *<i>obj</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdbusabstractadaptor.html#autoRelaySignals">autoRelaySignals</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusabstractadaptor.html#setAutoRelaySignals">setAutoRelaySignals</a></b>(bool <i>enable</i>)</td></tr> </table></div> <ul> <li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li> </ul> <a name="macros"></a> <h2 id="macros">Macros</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusabstractadaptor.html#Q_NOREPLY">Q_NOREPLY</a></b></td></tr> </table></div> <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> </ul> <a name="details"></a> <!-- $$$QDBusAbstractAdaptor-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> class is the base class of D-Bus adaptor classes.</p> <p>The <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> class is the starting point for all objects intending to provide interfaces to the external world using D-Bus. This is accomplished by attaching a one or more classes derived from <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> to a normal <a href="../qtcore/qobject.html">QObject</a> and then registering that <a href="../qtcore/qobject.html">QObject</a> with <a href="qdbusconnection.html#registerObject">QDBusConnection::registerObject</a>. <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> objects are intended to be light-weight wrappers, mostly just relaying calls into the real object (its parent) and the signals from it.</p> <p>Each <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a>-derived class should define the D-Bus interface it is implementing using the <a href="../qtcore/qobject.html#Q_CLASSINFO">Q_CLASSINFO</a> macro in the class definition. Note that only one interface can be exposed in this way.</p> <p><a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> uses the standard <a href="../qtcore/qobject.html">QObject</a> mechanism of signals, slots and properties to determine what signals, methods and properties to export to the bus. Any signal emitted by <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a>-derived classes will be automatically be relayed through any D-Bus connections the object is registered on.</p> <p>Classes derived from <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> must be created on the heap using the <i>new</i> operator and must not be deleted by the user (they will be deleted automatically when the object they are connected to is also deleted).</p> </div> <p><b>See also </b><a href="usingadaptors.html">Using adaptors</a> and <a href="qdbusconnection.html">QDBusConnection</a>.</p> <!-- @@@QDBusAbstractAdaptor --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QDBusAbstractAdaptor[overload1]$$$QDBusAbstractAdaptorQObject* --> <h3 class="fn" id="QDBusAbstractAdaptor"><a name="QDBusAbstractAdaptor"></a><code>[protected] </code>QDBusAbstractAdaptor::<span class="name">QDBusAbstractAdaptor</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>obj</i>)</h3> <p>Constructs a <a href="qdbusabstractadaptor.html">QDBusAbstractAdaptor</a> with <i>obj</i> as the parent object.</p> <!-- @@@QDBusAbstractAdaptor --> <!-- $$$~QDBusAbstractAdaptor[overload1]$$$~QDBusAbstractAdaptor --> <h3 class="fn" id="dtor.QDBusAbstractAdaptor"><a name="dtor.QDBusAbstractAdaptor"></a><code>[virtual] </code>QDBusAbstractAdaptor::<span class="name">~QDBusAbstractAdaptor</span>()</h3> <p>Destroys the adaptor.</p> <p><b>Warning:</b> Adaptors are destroyed automatically when the real object they refer to is destroyed. Do not delete the adaptors yourself.</p> <!-- @@@~QDBusAbstractAdaptor --> <!-- $$$autoRelaySignals[overload1]$$$autoRelaySignals --> <h3 class="fn" id="autoRelaySignals"><a name="autoRelaySignals"></a><code>[protected] </code><span class="type">bool</span> QDBusAbstractAdaptor::<span class="name">autoRelaySignals</span>() const</h3> <p>Returns <code>true</code> if automatic signal relaying from the real object (see object()) is enabled, otherwiser returns <code>false</code>.</p> <p><b>See also </b><a href="qdbusabstractadaptor.html#setAutoRelaySignals">setAutoRelaySignals</a>().</p> <!-- @@@autoRelaySignals --> <!-- $$$setAutoRelaySignals[overload1]$$$setAutoRelaySignalsbool --> <h3 class="fn" id="setAutoRelaySignals"><a name="setAutoRelaySignals"></a><code>[protected] </code><span class="type">void</span> QDBusAbstractAdaptor::<span class="name">setAutoRelaySignals</span>(<span class="type">bool</span> <i>enable</i>)</h3> <p>Toggles automatic signal relaying from the real object (see object()).</p> <p>Automatic signal relaying consists of signal-to-signal connection of the signals on the parent that have the exact same method signatue in both classes.</p> <p>If <i>enable</i> is set to true, connect the signals; if set to false, disconnect all signals.</p> <p><b>See also </b><a href="qdbusabstractadaptor.html#autoRelaySignals">autoRelaySignals</a>().</p> <!-- @@@setAutoRelaySignals --> </div> <div class="macros"> <h2>Macro Documentation</h2> <!-- $$$Q_NOREPLY[overload1]$$$Q_NOREPLY --> <h3 class="fn" id="Q_NOREPLY"><a name="Q_NOREPLY"></a><span class="name">Q_NOREPLY</span></h3> <p>The Q_NOREPLY macro can be used to mark a method to be called and not wait for it to finish processing before returning from <a href="qdbusabstractinterface.html#call">QDBusInterface::call</a>(). The called method cannot return any output arguments and, if it does, any such arguments will be discarded.</p> <p>You can use this macro in your own adaptors by placing it before your method's return value (which must be "void") in the class declaration, as shown in the example:</p> <pre class="cpp"> Q_NOREPLY <span class="type">void</span> myMethod(); </pre> <p>Its presence in the method implementation (outside the class declaration) is optional.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also </b><a href="usingadaptors.html">Using Qt D-Bus Adaptors</a>.</p> <!-- @@@Q_NOREPLY --> </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>