Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > c61c536f80c3d067f7ca643389c560f9 > files > 49

qtremoteobjects5-doc-5.12.2-2.mga7.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" />
<!-- remoteobjects-use.qdoc -->
  <title>Using Qt Remote Objects | Qt Remote Objects 5.12.2</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="qtremoteobjects-index.html">Qt Remote Objects</a></td><td >Using Qt Remote Objects</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtremoteobjects-index.html">Qt 5.12.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Using Qt Remote Objects</h1>
<span class="subtitle"></span>
<!-- $$$qtremoteobjects-use.html-description -->
<div class="descr"> <a name="details"></a>
<p>Consider a sensor; a global positioning system (GPS) receiver for instance. In QtRO terms, the <a href="qtremoteobjects-source.html#source">Source</a> would be the process that directly interacts with the GPS hardware and derives your current location. The location would be exposed as QObject properties, and the periodic updates to the location would update the properties and emit property changed signals. <a href="qtremoteobjects-replica.html#replica">Replica</a>s would be created in other processes and would always know your current location, but would not need any of the logic to compute the location from the sensor data. Connecting to the location changed signal on the <a href="qtremoteobjects-replica.html#replica">Replica</a> would work as expected, as the signal emitted from the <a href="qtremoteobjects-source.html#source">Source</a> would trigger the signal emission on every <a href="qtremoteobjects-replica.html#replica">Replica</a>.</p>
<p>Another example of QtRO usage would be for a service (for example, access to a printer). The <a href="qtremoteobjects-source.html#source">Source</a> is again the process controlling the printer directly. Here you would again likely have properties monitoring the ink levels or whether the printer is currently busy. However, the key feature, being able to print something, needs to be passed back to the printer. This aligns with the Qt slot mechanism, which QtRO uses as the way for <a href="qtremoteobjects-replica.html#replica">Replica</a>s to make calls on the <a href="qtremoteobjects-source.html#source">Source</a>. In effect, properties and signals go from <a href="qtremoteobjects-source.html#source">Source</a> to <a href="qtremoteobjects-replica.html#replica">Replica</a>s, while slots go from (a) <a href="qtremoteobjects-replica.html#replica">Replica</a> to the <a href="qtremoteobjects-source.html#source">Source</a>. Assuming a print request is accepted, the printer status would change, which would change the status property. This would then be reported to all <a href="qtremoteobjects-replica.html#replica">Replica</a>s.</p>
</div>
<!-- @@@qtremoteobjects-use.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</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>