diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-02-23 17:44:37 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-02-25 13:35:16 +0100 |
commit | be93534b314084330612c350dd58e695eb569646 (patch) | |
tree | c6bcaf5ebe2ebf132cea656be29f3a657f11f1a1 /examples/remoteobjects/simpleswitch | |
parent | b03bf04c19d4d9b81f92bd9a30ee7d26317a7315 (diff) |
Migrate from old signal/slot connection syntax
Exception is made for the cases, when the signals/slots are not known
at compile-time (i.e. involve dynamic replicas) or are defined in the
repc-generated files.
Pick-to: 5.15 5.12
Change-Id: Ice1fc78b59c713480531292a0401795df75523d7
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'examples/remoteobjects/simpleswitch')
4 files changed, 6 insertions, 4 deletions
diff --git a/examples/remoteobjects/simpleswitch/directconnectdynamicclient/dynamicclient.cpp b/examples/remoteobjects/simpleswitch/directconnectdynamicclient/dynamicclient.cpp index 11f64ab..88a3fd8 100644 --- a/examples/remoteobjects/simpleswitch/directconnectdynamicclient/dynamicclient.cpp +++ b/examples/remoteobjects/simpleswitch/directconnectdynamicclient/dynamicclient.cpp @@ -56,7 +56,8 @@ 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(), SIGNAL(initialized()), this, SLOT(initConnection_slot())); + QObject::connect(reptr.data(), &QRemoteObjectDynamicReplica::initialized, this, + &DynamicClient::initConnection_slot); } //destructor diff --git a/examples/remoteobjects/simpleswitch/directconnectserver/simpleswitch.cpp b/examples/remoteobjects/simpleswitch/directconnectserver/simpleswitch.cpp index a5ab3e0..5418ce1 100644 --- a/examples/remoteobjects/simpleswitch/directconnectserver/simpleswitch.cpp +++ b/examples/remoteobjects/simpleswitch/directconnectserver/simpleswitch.cpp @@ -54,7 +54,7 @@ SimpleSwitch::SimpleSwitch(QObject *parent) : SimpleSwitchSimpleSource(parent) { stateChangeTimer = new QTimer(this); // Initialize timer - QObject::connect(stateChangeTimer, SIGNAL(timeout()), this, SLOT(timeout_slot())); // connect timeout() signal from stateChangeTimer to timeout_slot() of simpleSwitch + QObject::connect(stateChangeTimer, &QTimer::timeout, this, &SimpleSwitch::timeout_slot); // connect timeout() signal from stateChangeTimer to timeout_slot() of simpleSwitch stateChangeTimer->start(2000); // Start timer and set timout to 2 seconds qDebug() << "Source Node Started"; } diff --git a/examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp b/examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp index 11f64ab..88a3fd8 100644 --- a/examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp +++ b/examples/remoteobjects/simpleswitch/registryconnectedclient/dynamicclient.cpp @@ -56,7 +56,8 @@ 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(), SIGNAL(initialized()), this, SLOT(initConnection_slot())); + QObject::connect(reptr.data(), &QRemoteObjectDynamicReplica::initialized, this, + &DynamicClient::initConnection_slot); } //destructor diff --git a/examples/remoteobjects/simpleswitch/registryconnectedserver/simpleswitch.cpp b/examples/remoteobjects/simpleswitch/registryconnectedserver/simpleswitch.cpp index a5ab3e0..5418ce1 100644 --- a/examples/remoteobjects/simpleswitch/registryconnectedserver/simpleswitch.cpp +++ b/examples/remoteobjects/simpleswitch/registryconnectedserver/simpleswitch.cpp @@ -54,7 +54,7 @@ SimpleSwitch::SimpleSwitch(QObject *parent) : SimpleSwitchSimpleSource(parent) { stateChangeTimer = new QTimer(this); // Initialize timer - QObject::connect(stateChangeTimer, SIGNAL(timeout()), this, SLOT(timeout_slot())); // connect timeout() signal from stateChangeTimer to timeout_slot() of simpleSwitch + QObject::connect(stateChangeTimer, &QTimer::timeout, this, &SimpleSwitch::timeout_slot); // connect timeout() signal from stateChangeTimer to timeout_slot() of simpleSwitch stateChangeTimer->start(2000); // Start timer and set timout to 2 seconds qDebug() << "Source Node Started"; } |