diff options
| author | Leander Beernaert <leander.beernaert@qt.io> | 2020-01-22 13:47:08 +0100 |
|---|---|---|
| committer | Leander Beernaert <leander.beernaert@qt.io> | 2020-01-24 13:17:33 +0100 |
| commit | 502d3d6744913899da87acfda5ebdab42c40329e (patch) | |
| tree | 16658a328503bfd5a62b4fd5d69ffb66e9854b18 /examples/network/network-chat/connection.cpp | |
| parent | d1be8b9ceb2c7b20bbe53a07154c79699540ea3d (diff) | |
| parent | 06bb315beb6c2c398223cfe52cbc7f66e14a8557 (diff) | |
Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
Diffstat (limited to 'examples/network/network-chat/connection.cpp')
| -rw-r--r-- | examples/network/network-chat/connection.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/network/network-chat/connection.cpp b/examples/network/network-chat/connection.cpp index 58cf67eb6d8..cffd495349f 100644 --- a/examples/network/network-chat/connection.cpp +++ b/examples/network/network-chat/connection.cpp @@ -82,11 +82,14 @@ Connection::Connection(QObject *parent) isGreetingMessageSent = false; pingTimer.setInterval(PingInterval); - QObject::connect(this, SIGNAL(readyRead()), this, SLOT(processReadyRead())); - QObject::connect(this, SIGNAL(disconnected()), &pingTimer, SLOT(stop())); - QObject::connect(&pingTimer, SIGNAL(timeout()), this, SLOT(sendPing())); - QObject::connect(this, SIGNAL(connected()), - this, SLOT(sendGreetingMessage())); + connect(this, &QTcpSocket::readyRead, this, + &Connection::processReadyRead); + connect(this, &QTcpSocket::disconnected, + &pingTimer, &QTimer::stop); + connect(&pingTimer, &QTimer::timeout, + this, &Connection::sendPing); + connect(this, &QTcpSocket::connected, + this, &Connection::sendGreetingMessage); } Connection::Connection(qintptr socketDescriptor, QObject *parent) |
