diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-02-25 14:40:51 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-02-26 17:48:33 +0100 |
commit | 32b60c566f74c86ac51cd96ede41d85a0c95a298 (patch) | |
tree | 2df547627630b6e6a04d4e8956a7334efad43842 /examples | |
parent | a1c28ab5317cdcbe15310ac11d07d4ffd0bec3f7 (diff) |
Migrate from old signal/slot connection syntax (part 2)
Change the syntax also for the connections that involve types that
are defined in the repc-generated files.
Pick-to: 5.15 5.12
Change-Id: I222a59c8fae438c5f0026e66a75d0fa905e49ccf
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/remoteobjects/plugins/plugin.cpp | 10 | ||||
-rw-r--r-- | examples/remoteobjects/simpleswitch/directconnectclient/client.cpp | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/examples/remoteobjects/plugins/plugin.cpp b/examples/remoteobjects/plugins/plugin.cpp index bddab06..eac6313 100644 --- a/examples/remoteobjects/plugins/plugin.cpp +++ b/examples/remoteobjects/plugins/plugin.cpp @@ -76,11 +76,11 @@ public: TimeModel(QObject *parent = nullptr) : QObject(parent), d_ptr(nullptr) { d_ptr.reset(m_client.acquire< MinuteTimerReplica >()); - connect(d_ptr.data(), SIGNAL(hourChanged(int)), this, SIGNAL(timeChanged())); - connect(d_ptr.data(), SIGNAL(minuteChanged(int)), this, SIGNAL(timeChanged())); - connect(d_ptr.data(), SIGNAL(timeChanged()), this, SIGNAL(timeChanged())); - connect(d_ptr.data(), SIGNAL(timeChanged2(QTime)), this, SLOT(test(QTime))); - connect(d_ptr.data(), SIGNAL(sendCustom(PresetInfo)), this, SLOT(testCustom(PresetInfo))); + connect(d_ptr.data(), &MinuteTimerReplica::hourChanged, this, &TimeModel::timeChanged); + connect(d_ptr.data(), &MinuteTimerReplica::minuteChanged, this, &TimeModel::timeChanged); + connect(d_ptr.data(), &MinuteTimerReplica::timeChanged, this, &TimeModel::timeChanged); + connect(d_ptr.data(), &MinuteTimerReplica::timeChanged2, this, &TimeModel::test); + connect(d_ptr.data(), &MinuteTimerReplica::sendCustom, this, &TimeModel::testCustom); } ~TimeModel() override diff --git a/examples/remoteobjects/simpleswitch/directconnectclient/client.cpp b/examples/remoteobjects/simpleswitch/directconnectclient/client.cpp index 81cbf0e..a8e3133 100644 --- a/examples/remoteobjects/simpleswitch/directconnectclient/client.cpp +++ b/examples/remoteobjects/simpleswitch/directconnectclient/client.cpp @@ -69,12 +69,12 @@ Client::~Client() void Client::initConnections(void) { - // initialize connections between signals and slots + // 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(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))); + // connect source replica signal currStateChanged() with client's recSwitchState() slot to receive source's current state + QObject::connect(reptr.data(), &SimpleSwitchReplica::currStateChanged, this, &Client::recSwitchState_slot); + // connect client's echoSwitchState(..) signal with replica's server_slot(..) to echo back received state + QObject::connect(this, &Client::echoSwitchState, reptr.data(), &SimpleSwitchReplica::server_slot); } void Client::recSwitchState_slot(bool value) |