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/client.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/client.cpp')
| -rw-r--r-- | examples/network/network-chat/client.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/network/network-chat/client.cpp b/examples/network/network-chat/client.cpp index b76ef182380..d4511818132 100644 --- a/examples/network/network-chat/client.cpp +++ b/examples/network/network-chat/client.cpp @@ -60,10 +60,10 @@ Client::Client() peerManager->setServerPort(server.serverPort()); peerManager->startBroadcasting(); - QObject::connect(peerManager, SIGNAL(newConnection(Connection*)), - this, SLOT(newConnection(Connection*))); - QObject::connect(&server, SIGNAL(newConnection(Connection*)), - this, SLOT(newConnection(Connection*))); + connect(peerManager, &PeerManager::newConnection, + this, &Client::newConnection); + connect(&server, &Server::newConnection, + this, &Client::newConnection); } void Client::sendMessage(const QString &message) @@ -102,10 +102,10 @@ void Client::newConnection(Connection *connection) { connection->setGreetingMessage(peerManager->userName()); - connect(connection, SIGNAL(error(QAbstractSocket::SocketError)), - this, SLOT(connectionError(QAbstractSocket::SocketError))); - connect(connection, SIGNAL(disconnected()), this, SLOT(disconnected())); - connect(connection, SIGNAL(readyForUse()), this, SLOT(readyForUse())); + connect(connection, QOverload<QAbstractSocket::SocketError>::of(&Connection::error), + this, &Client::connectionError); + connect(connection, &Connection::disconnected, this, &Client::disconnected); + connect(connection, &Connection::readyForUse, this, &Client::readyForUse); } void Client::readyForUse() @@ -115,8 +115,8 @@ void Client::readyForUse() connection->peerPort())) return; - connect(connection, SIGNAL(newMessage(QString,QString)), - this, SIGNAL(newMessage(QString,QString))); + connect(connection, &Connection::newMessage, + this, &Client::newMessage); peers.insert(connection->peerAddress(), connection); QString nick = connection->name(); |
