<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- remoteobjects-index.qdoc --> <title>Qt Remote Objects 5.9</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 >Qt Remote Objects</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="#remote-object-concepts">Remote Object Concepts</a></li> <li class="level1"><a href="#related-information">Related Information</a></li> <li class="level2"><a href="#getting-started">Getting Started</a></li> <li class="level2"><a href="#guides">Guides</a></li> <li class="level2"><a href="#reference">Reference</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Qt Remote Objects</h1> <span class="subtitle"></span> <!-- $$$qtremoteobjects-index.html-description --> <div class="descr"> <a name="details"></a> <a name="qt-remote-objects"></a><a name="remote-object-concepts"></a> <h2 id="remote-object-concepts">Remote Object Concepts</h2> <p>Qt Remote Objects (QtRO) is an inter-process communication (IPC) module developed for Qt. The idea is to extend existing Qt's functionalities to enable an easy exchange of information between processes or computers.</p> <p>One of the key features of Qt to enable this is the distinction between an objects API (defined by its Q_Property, Signals and Slots) and the implementation of that API. The purpose of QtRO is to meet the expected API, even if the true QObject is in a different process. A Slot called on a copy of an object (called a <a href="qtremoteobjects-replica.html#replica">Replica</a> in QtRO) is forwarded to the true object (called a <a href="qtremoteobjects-source.html#source">Source</a> in QtRO) for handling. Updates to the <a href="qtremoteobjects-source.html#source">Source</a> (either property changes or emitted Signals) are forwarded to every <a href="qtremoteobjects-replica.html#replica">Replica</a>.</p> <p>A <a href="qtremoteobjects-replica.html#replica">Replica</a> is a light-weight proxy for the <a href="qtremoteobjects-source.html#source">Source</a> object, but one that supports the same connections and behavior of QObjects, which makes them as easy to use as any other QObject provided by Qt. Everything needed for the <a href="qtremoteobjects-replica.html#replica">Replica</a> to look like the <a href="qtremoteobjects-source.html#source">Source</a> object is handled behind the scenes by QtRO.</p> <p>Note that Remote Objects behave differently from traditional remote procedure call (RPC) implementations. In RPC, the client makes a request and waits for the response. In RPC, the server does not push anything to the client unless it is in response to a request. The design of RPC is often such that different clients are independent of each other (for instance, two clients can ask a mapping service for directions and get different results). While it is possible to implement this in QtRO (as <a href="qtremoteobjects-source.html#source">Source</a> without properties, and Slots that have return values), it is designed more to hide the fact that the processing is really remote. You let a node give you the <a href="qtremoteobjects-replica.html#replica">Replica</a> instead of creating it yourself, possibly use the status signals (<a href="qremoteobjectreplica.html#isReplicaValid">isReplicaValid()</a>), but then interact with the object like you would with any other QObject-based type.</p> <a name="related-information"></a> <h2 id="related-information">Related Information</h2> <a name="getting-started"></a> <h3 >Getting Started</h3> <p>To enable <i>Qt Remote Objects</i> in a project, add this directive into the C++ files:</p> <pre class="cpp"> <span class="preprocessor">#include <QtRemoteObjects></span> </pre> <p>To link against the <i>Qt Remote Objects</i> module, add this line to the project file:</p> <pre class="cpp"> QT <span class="operator">+</span><span class="operator">=</span> remoteobjects </pre> <a name="guides"></a> <h3 >Guides</h3> <ul> <li><a href="qtremoteobjects-gettingstarted.html">Overview Qt Remote Objects</a></li> <li><a href="qtremoteobjects-module.html">Qt Remote Objects C++ Classes</a></li> <li><a href="qtremoteobjects-node.html">Qt Remote Objects Nodes</a></li> <li><a href="qtremoteobjects-source.html#source-objects">Qt Remote Objects Source Objects</a></li> <li><a href="qtremoteobjects-replica.html#replica-objects">Qt Remote Objects Replica Objects</a></li> <li><a href="qtremoteobjects-registry.html">Qt Remote Objects Registry</a></li> <li><a href="qtremoteobjects-repc.html">Qt Remote Objects Compiler</a></li> <li><a href="qtremoteobjects-interaction.html#remote-object-interaction">Remote Object Interaction</a></li> <li>Using Qt RemoteObjects</li> <li>Troubleshooting Qt Remote Objects</li> </ul> <a name="reference"></a> <h3 >Reference</h3> <p><a href="qtremoteobjects-module.html">Qt Remote Objects C++ Classes</a></p> </div> <!-- @@@qtremoteobjects-index.html --> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</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>