summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <mbrasser@ford.com>2018-10-02 09:07:24 -0500
committerMichael Brasser <michael.brasser@live.com>2018-10-02 16:21:18 +0000
commit0ebd459bf781ff22a4a0aac460c230874cc0fe52 (patch)
tree1ce3db9e28b9c0c0f0806987d715a8f3b33fb704
parentc27f6f7cba7cda4ce6b8acf78d9151a174e8c8f8 (diff)
Update code snippets to match latest APIsv5.12.0-beta1
Change-Id: I2bbf6f9c0d4f1549963ec8694cc815cac4d03982 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
-rw-r--r--src/remoteobjects/doc/snippets/doc_src_simpleswitch.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/remoteobjects/doc/snippets/doc_src_simpleswitch.cpp b/src/remoteobjects/doc/snippets/doc_src_simpleswitch.cpp
index 5711c02..9257489 100644
--- a/src/remoteobjects/doc/snippets/doc_src_simpleswitch.cpp
+++ b/src/remoteobjects/doc/snippets/doc_src_simpleswitch.cpp
@@ -111,7 +111,7 @@ void SimpleSwitch::timeout_slot()
//! [simpleSwitch_serversource_example1]
//! [simpleSwitch_serverhostnode_example1]
-QRemoteObjectHost srcNode;
+QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:switch")));
//! [simpleSwitch_serverhostnode_example1]
//! [simpleSwitch_enableremoting_example1]
@@ -129,9 +129,7 @@ int main(int argc, char *argv[])
SimpleSwitch srcSwitch; // create simple switch
- QRemoteObjectHost srcNode; // create host node without Registry
- //The static node creation routines take one or two URLs as input parameters, but they have default values to help people getting started.
- //It is recommended use your own URLs in any production environment to avoid name conflicts.
+ QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:switch")); // create host node without Registry
srcNode.enableRemoting(&srcSwitch); // enable remoting/sharing
return a.exec();
@@ -144,7 +142,7 @@ REPC_REPLICA = simpleswitch.rep
//! [simpleSwitch_clientremotenode_example1]
QRemoteObjectNode repNode; // create remote object node
-repNode.connect(); // connect with remote host node
+repNode.connectToNode(QUrl(QStringLiteral("local:switch")); // connect with remote host node
//! [simpleSwitch_clientremotenode_example1]
//! [simpleSwitch_clientacquirereplica_example1]
@@ -230,7 +228,7 @@ int main(int argc, char *argv[])
QSharedPointer<SimpleSwitchReplica> ptr; // shared pointer to hold source replica
QRemoteObjectNode repNode; // create remote object node
- repNode.connect(); // connect with remote host node
+ repNode.connectToNode(QUrl(QStringLiteral("local:switch")); // connect with remote host node
ptr.reset(repNode.acquire<SimpleSwitchReplica>()); // acquire replica of source from host node
@@ -242,7 +240,7 @@ int main(int argc, char *argv[])
//! [simpleSwitch_dynamicclientnode_example2]
QRemoteObjectNode repNode; // create remote object node
-repNode.connect(); // connect with remote host node
+repNode.connectToNode(QUrl(QStringLiteral("local:switch")); // connect with remote host node
//! [simpleSwitch_dynamicclientnode_example2]
//! [simpleSwitch_dynamicclientacquirereplica_example2]
@@ -329,7 +327,8 @@ int main(int argc, char *argv[])
QSharedPointer<QRemoteObjectDynamicReplica> ptr; // shared pointer to hold replica
- QRemoteObjectNode repNode(QUrl(QStringLiteral("local:registry")));
+ QRemoteObjectNode repNode;
+ repNode.connectToNode(QUrl(QStringLiteral("local:switch"));
ptr.reset(repNode.acquireDynamic("SimpleSwitch")); // acquire replica of source from host node
@@ -348,7 +347,7 @@ int main(int argc, char *argv[])
SimpleSwitch srcSwitch; // create SimpleSwitch
QRemoteObjectRegistryHost regNode(QUrl(QStringLiteral("local:registry"))); // create node that hosts registry
- QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:switch")), QUrl(QStringLiteral("local:registry"))); // create node that will host source and connect to registry
+ QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:switch")), QUrl(QStringLiteral("local:registry"))); // create node that will host source and connect to registry
//Note, you can add srcSwitch directly to regNode if desired.
//We use two Nodes here, as the regNode could easily be in a third process.