diff options
author | Brett Stottlemyer <bstottle@ford.com> | 2016-03-05 13:27:32 -0500 |
---|---|---|
committer | Brett Stottlemyer <bstottle@ford.com> | 2016-03-07 14:47:50 +0000 |
commit | 6086f56ad2c9179b68dcca26dd4a110b3d08f0ec (patch) | |
tree | 234dc682b1cb3433c621e0e3b3c50a8077ab23e4 /examples | |
parent | 525f682adda5df321c069634385f76271960f4c2 (diff) |
Fix SimpleSwitch examples
Change-Id: Ie8acd25ad9adadbedfee9f59b667c8ff2befaed1
Reviewed-by: Continuous Integration (KDAB) <build@kdab.com>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'examples')
6 files changed, 12 insertions, 12 deletions
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp index 971d4fa..0500693 100644 --- a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp +++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp @@ -63,14 +63,14 @@ void Client::initConnections(void) // initialize connections between signals and slots // connect source replica signal currStateChanged() with client's recSwitchState() slot to receive source's current state - QObject::connect(reptr.data(), SIGNAL(currStateChanged()), this, SLOT(recSwitchState_slot())); + 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 Client::recSwitchState_slot() +void Client::recSwitchState_slot(bool value) { - qDebug() << "Received source state "<<reptr.data()->currState(); + qDebug() << "Received source state "<< value << reptr.data()->currState(); clientSwitchState = reptr.data()->currState(); Q_EMIT echoSwitchState(clientSwitchState); // Emit signal to echo received state back to server } diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h index 64d5eef..2691faa 100644 --- a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h +++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h @@ -59,7 +59,7 @@ Q_SIGNALS: void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) on the source object and echoes back switch state received from source public Q_SLOTS: - void recSwitchState_slot(); // slot to receive source state + void recSwitchState_slot(bool); // slot to receive source state private: bool clientSwitchState; // holds received server switch state QSharedPointer<SimpleSwitchReplica> reptr;// holds reference to replica diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp index 3bc6f30..86e4e8e 100644 --- a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp +++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp @@ -61,16 +61,16 @@ 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()), this, SLOT(recSwitchState_slot())); + 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() +void DynamicClient::recSwitchState_slot(bool value) { clientSwitchState = reptr->property("currState").toBool(); // use replica property to get "currState" from source - qDebug() << "Received source state " << clientSwitchState; + qDebug() << "Received source state " << value << clientSwitchState; Q_EMIT echoSwitchState(clientSwitchState); // Emit signal to echo received state back to server } diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h index 88f2d4d..8faa6dd 100644 --- a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h +++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h @@ -59,7 +59,7 @@ Q_SIGNALS: void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) slot of source object and echoes back switch state received from source public Q_SLOTS: - void recSwitchState_slot(); // slot to receive source state + void recSwitchState_slot(bool); // slot to receive source state void initConnection_slot(); private: diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp index 3bc6f30..86e4e8e 100644 --- a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp +++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp @@ -61,16 +61,16 @@ 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()), this, SLOT(recSwitchState_slot())); + 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() +void DynamicClient::recSwitchState_slot(bool value) { clientSwitchState = reptr->property("currState").toBool(); // use replica property to get "currState" from source - qDebug() << "Received source state " << clientSwitchState; + qDebug() << "Received source state " << value << clientSwitchState; Q_EMIT echoSwitchState(clientSwitchState); // Emit signal to echo received state back to server } diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h index 88f2d4d..8faa6dd 100644 --- a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h +++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h @@ -59,7 +59,7 @@ Q_SIGNALS: void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) slot of source object and echoes back switch state received from source public Q_SLOTS: - void recSwitchState_slot(); // slot to receive source state + void recSwitchState_slot(bool); // slot to receive source state void initConnection_slot(); private: |