diff options
author | Γystein Heskestad <oystein.heskestad@qt.io> | 2023-09-21 15:21:16 +0200 |
---|---|---|
committer | Γystein Heskestad <oystein.heskestad@qt.io> | 2023-09-22 15:17:26 +0200 |
commit | cc349f6ee3ba05e9f3c53cd96b7d7d5565227cb4 (patch) | |
tree | 6a6a4284940b29eae154799b1fd854719757a1ca /examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp | |
parent | db9f186d4f14ec9e9834529dcc04b7d8b3533e19 (diff) |
Move some simpleswitch examples to tests/manual/examples
There have already been created snippets based on these small examples
used in the remote objects documentation.
Task-number: QTBUG-112850
Pick-to: 6.6 6.5
Change-Id: Ib495eea8f8416831229961acd8f873b943da317d
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp')
-rw-r--r-- | examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp b/examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp deleted file mode 100644 index 6f88fa6..0000000 --- a/examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 Ford Motor Company -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include "dynamicclient.h" - #include <QMetaMethod> - -// constructor -DynamicClient::DynamicClient(QSharedPointer<QRemoteObjectDynamicReplica> ptr) : - QObject(nullptr), clientSwitchState(false), reptr(ptr) -{ - //connect signal for replica valid changed with signal slot initialization - QObject::connect(reptr.data(), &QRemoteObjectDynamicReplica::initialized, this, - &DynamicClient::initConnection_slot); -} - -//destructor -DynamicClient::~DynamicClient() -{ - -} - -// Function to initialize connections between slots and signals -void DynamicClient::initConnection_slot() -{ - - // connect source replica signal currStateChanged() with client's recSwitchState() slot to receive source's current state - QObject::connect(reptr.data(), SIGNAL(currStateChanged(bool)), this, SLOT(recSwitchState_slot(bool))); - // connect client's echoSwitchState(..) signal with replica's server_slot(..) to echo back received state - QObject::connect(this, SIGNAL(echoSwitchState(bool)),reptr.data(), SLOT(server_slot(bool))); -} - - -void DynamicClient::recSwitchState_slot(bool value) -{ - clientSwitchState = reptr->property("currState").toBool(); // use replica property to get "currState" from source - qDebug() << "Received source state " << value << clientSwitchState; - Q_EMIT echoSwitchState(clientSwitchState); // Emit signal to echo received state back to server -} - |