From e85de7d787498624020884ef2e269c15faf76b50 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 1 Nov 2019 13:21:32 +0100 Subject: Cleanup network examples Cleanup network examples: - use nullptr - use member-init - adjust includes - use new-style connects Change-Id: I80aa230168e5aec88a1bc93bbf49a471bfc30e7b Reviewed-by: Timur Pocheptsov --- examples/network/network-chat/connection.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'examples/network/network-chat/connection.cpp') diff --git a/examples/network/network-chat/connection.cpp b/examples/network/network-chat/connection.cpp index 58cf67eb6d..cffd495349 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) -- cgit v1.2.3