diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2022-11-24 22:57:53 +0100 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@idiap.ch> | 2022-11-25 09:26:13 +0100 |
commit | fdb18a90367cfc97a1cc12913f84a9819baa001e (patch) | |
tree | 49ac3e0c0561e2f81afd34ca53ade959570329bf | |
parent | 182fa60432e68d8aaed9a6a7ad761edda33e27f8 (diff) |
examples: port bluetooth examples to new connection style
Fixes: QTBUG-108846
Change-Id: I09bd69625a0841cea6a642a8195369bbe566aee8
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | examples/bluetooth/btchat/remoteselector.cpp | 10 | ||||
-rw-r--r-- | examples/bluetooth/pingpong/pingpong.cpp | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/examples/bluetooth/btchat/remoteselector.cpp b/examples/bluetooth/btchat/remoteselector.cpp index 5872cec5..a0a8430c 100644 --- a/examples/bluetooth/btchat/remoteselector.cpp +++ b/examples/bluetooth/btchat/remoteselector.cpp @@ -16,10 +16,12 @@ RemoteSelector::RemoteSelector(const QBluetoothAddress &localAdapter, QWidget *p m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(localAdapter); - connect(m_discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), - this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); - connect(m_discoveryAgent, SIGNAL(finished()), this, SLOT(discoveryFinished())); - connect(m_discoveryAgent, SIGNAL(canceled()), this, SLOT(discoveryFinished())); + connect(m_discoveryAgent, &QBluetoothServiceDiscoveryAgent::serviceDiscovered, + this, &RemoteSelector::serviceDiscovered); + connect(m_discoveryAgent, &QBluetoothServiceDiscoveryAgent::finished, + this, &RemoteSelector::discoveryFinished); + connect(m_discoveryAgent, &QBluetoothServiceDiscoveryAgent::canceled, + this, &RemoteSelector::discoveryFinished); } RemoteSelector::~RemoteSelector() diff --git a/examples/bluetooth/pingpong/pingpong.cpp b/examples/bluetooth/pingpong/pingpong.cpp index 30775ab1..abea85dc 100644 --- a/examples/bluetooth/pingpong/pingpong.cpp +++ b/examples/bluetooth/pingpong/pingpong.cpp @@ -205,7 +205,7 @@ void PingPong::checkResult() setMessage("Game over. You lose! Next game starts in 10s"); } m_timer->stop(); - QTimer::singleShot(10000, this, SLOT(startGame())); + QTimer::singleShot(10000, this, &PingPong::startGame); } void PingPong::startServer() @@ -279,7 +279,7 @@ void PingPong::clientConnected() //! [Initiating server socket] setMessage(QStringLiteral("Client connected. Get ready!")); - QTimer::singleShot(3000, this, SLOT(startGame())); + QTimer::singleShot(3000, this, &PingPong::startGame); } void PingPong::clientDisconnected() @@ -344,7 +344,7 @@ QString PingPong::message() const void PingPong::serverConnected() { setMessage("Server Connected. Get ready!"); - QTimer::singleShot(3000, this, SLOT(startGame())); + QTimer::singleShot(3000, this, &PingPong::startGame); } void PingPong::serverDisconnected() |