<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qconnectionfactories.cpp --> <title>QtROServerFactory Class | 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 ><a href="qtremoteobjects-index.html">Qt Remote Objects</a></td><td ><a href="qtremoteobjects-module.html">C++ Classes</a></td><td >QtROServerFactory</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="#related-non-members">Related Non-Members</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">QtROServerFactory Class</h1> <!-- $$$QtROServerFactory-brief --> <p>A class holding information about server backends available on the Qt Remote Objects network <a href="#details">More...</a></p> <!-- @@@QtROServerFactory --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QtROServerFactory></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += remoteobjects</td></tr></table></div><ul> <li><a href="qtroserverfactory-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"> QConnectionAbstractServer *</td><td class="memItemRight bottomAlign"><b><a href="qtroserverfactory.html#create">create</a></b>(const QUrl &<i>url</i>, QObject *<i>parent</i> = nullptr)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtroserverfactory.html#registerType">registerType</a></b>(const QString &<i>id</i>)</td></tr> </table></div> <a name="related-non-members"></a> <h2 id="related-non-members">Related Non-Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtroserverfactory.html#qRegisterRemoteObjectsServer">qRegisterRemoteObjectsServer</a></b>(const QString &<i>id</i>)</td></tr> </table></div> <a name="details"></a> <!-- $$$QtROServerFactory-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>A class holding information about server backends available on the Qt Remote Objects network</p> </div> <!-- @@@QtROServerFactory --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$create[overload1]$$$createconstQUrl&QObject* --> <h3 class="fn" id="create"><a name="create"></a><span class="type">QConnectionAbstractServer</span> *QtROServerFactory::<span class="name">create</span>(const <span class="type">QUrl</span> &<i>url</i>, <span class="type">QObject</span> *<i>parent</i> = nullptr)</h3> <!-- @@@create --> <!-- $$$registerType[overload1]$$$registerTypeconstQString& --> <h3 class="fn" id="registerType"><a name="registerType"></a><span class="type">void</span> QtROServerFactory::<span class="name">registerType</span>(const <span class="type">QString</span> &<i>id</i>)</h3> <!-- @@@registerType --> </div> <div class="relnonmem"> <h2>Related Non-Members</h2> <!-- $$$qRegisterRemoteObjectsServer[overload1]$$$qRegisterRemoteObjectsServerconstQString& --> <h3 class="fn" id="qRegisterRemoteObjectsServer"><a name="qRegisterRemoteObjectsServer"></a><span class="type">void</span> <span class="name">qRegisterRemoteObjectsServer</span>(const <span class="type">QString</span> &<i>id</i>)</h3> <p>Registers the Remote Objects server <i>id</i> for the type <code>T</code>.</p> <p>If you need a custom transport protocol for Qt Remote Objects, you need to register the client & server implementation here.</p> <p><b>Note: </b>This function requires that <code>T</code> is a fully defined type at the point where the function is called.</p><p>This example registers the class <code>CustomServerImpl</code> as <code>"myprotocol"</code>:</p> <pre class="cpp"> qRegisterRemoteObjectsServer<span class="operator"><</span>CustomServerImpl<span class="operator">></span>(<span class="type">QStringLiteral</span>(<span class="string">"myprotocol"</span>)); </pre> <p>With this in place, you can now instantiate nodes using this new custom protocol:</p> <pre class="cpp"> <span class="type"><a href="qremoteobjectnode.html">QRemoteObjectNode</a></span> client(<span class="type">QUrl</span>(<span class="type">QStringLiteral</span>(<span class="string">"myprotocol:registry"</span>))); </pre> <p><b>See also </b>qRegisterRemoteObjectsServer.</p> <!-- @@@qRegisterRemoteObjectsServer --> </div> </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>