<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qtdbus-cmake.qdoc --> <title>qt5_add_dbus_interface | 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 >qt5_add_dbus_interface</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="#synopsis">Synopsis</a></li> <li class="level1"><a href="#description">Description</a></li> <li class="level1"><a href="#options">Options</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">qt5_add_dbus_interface</h1> <span class="subtitle"></span> <!-- $$$qtdbus-cmake-qt5-add-dbus-interface.html-description --> <div class="descr"> <a name="details"></a> <a name="synopsis"></a> <h2 id="synopsis">Synopsis</h2> <pre class="cpp plain"> qt5_add_dbus_interface(<VAR> dbus_spec basename) </pre> <a name="description"></a> <h2 id="description">Description</h2> <p>Generates C++ sources implementing an interface for a D-Bus interface description file defined in <code>dbus_spec</code>. The generated files are named after <code>basename</code>: <code>basename.h</code>, <code>basename.cpp</code>, <code>basename.moc</code>. The paths of the files are added to <code><VAR></code>.</p> <p>The function sets up a call to the <a href="qdbusxml2cpp.html">Qt D-Bus XML compiler (qdbusxml2cpp)</a> in interface (proxy) mode. By default, <code>qdbusxml2cpp</code> generates a C++ class named after the interface name, with a namespaced alias:</p> <div class="table"><table class="generic"> <thead><tr class="qt-style"><th >D-Bus Interface Name</th><th >Class name</th><th >Namespaced name</th></tr></thead> <tr valign="top" class="odd"><td ><code>org.example.chat</code></td><td ><code>OrgExampleChatInterface</code></td><td ><code>org.example.chat</code></td></tr> </table></div> <a name="options"></a> <h2 id="options">Options</h2> <p>Options can be set using <code>set_source_file_property</code> on the <code>dbus_spec</code>:</p> <div class="table"><table class="generic"> <thead><tr class="qt-style"><th >Option</th><th >Value</th><th >Description</th></tr></thead> <tr valign="top" class="odd"><td ><code>CLASSNAME</code></td><td ><code>class_name</code></td><td >Override the default interface class name with <code>class_name</code>.</td></tr> <tr valign="top" class="even"><td ><code>NO_NAMESPACE</code></td><td >boolean</td><td >Do not generate the namespaced name if set to <code>ON</code>.</td></tr> <tr valign="top" class="odd"><td ><code>INCLUDE</code></td><td ><code>path</code></td><td >Add an <code>#include "path"</code> in the generated code.</td></tr> </table></div> </div> <!-- @@@qtdbus-cmake-qt5-add-dbus-interface.html --> </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>