From e686a13b7b2e37924e8d2a08187a538cf56a0ff3 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 23 Nov 2022 23:00:39 +0100 Subject: [PATCH] examples: port network examples to new connection style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-106893 Change-Id: Id0f558362108fedececb9eede36becc04ff4e307 Reviewed-by: Jörg Bornemann --- examples/network/dnslookup/dnslookup.cpp | 2 +- examples/network/download/main.cpp | 2 +- examples/network/network-chat/chatdialog.cpp | 2 +- examples/network/secureudpclient/mainwindow.cpp | 2 +- examples/network/torrent/ratecontroller.cpp | 2 +- examples/network/torrent/trackerclient.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/network/dnslookup/dnslookup.cpp b/examples/network/dnslookup/dnslookup.cpp index 91311b26b81..c0f593563cb 100644 --- a/examples/network/dnslookup/dnslookup.cpp +++ b/examples/network/dnslookup/dnslookup.cpp @@ -200,7 +200,7 @@ int main(int argc, char *argv[]) DnsManager manager; manager.setQuery(query); - QTimer::singleShot(0, &manager, SLOT(execute())); + QTimer::singleShot(0, &manager, &DnsManager::execute); return app.exec(); } diff --git a/examples/network/download/main.cpp b/examples/network/download/main.cpp index 227035af694..25543a439e9 100644 --- a/examples/network/download/main.cpp +++ b/examples/network/download/main.cpp @@ -158,7 +158,7 @@ int main(int argc, char **argv) QCoreApplication app(argc, argv); DownloadManager manager; - QTimer::singleShot(0, &manager, SLOT(execute())); + QTimer::singleShot(0, &manager, &DownloadManager::execute); app.exec(); } diff --git a/examples/network/network-chat/chatdialog.cpp b/examples/network/network-chat/chatdialog.cpp index ddec5c2997e..7cf2c9fd4e3 100644 --- a/examples/network/network-chat/chatdialog.cpp +++ b/examples/network/network-chat/chatdialog.cpp @@ -27,7 +27,7 @@ ChatDialog::ChatDialog(QWidget *parent) myNickName = client.nickName(); newParticipant(myNickName); tableFormat.setBorder(0); - QTimer::singleShot(10 * 1000, this, SLOT(showInformation())); + QTimer::singleShot(10 * 1000, this, &ChatDialog::showInformation); } void ChatDialog::appendMessage(const QString &from, const QString &message) diff --git a/examples/network/secureudpclient/mainwindow.cpp b/examples/network/secureudpclient/mainwindow.cpp index 8b9ac24c62b..987eb739b9d 100644 --- a/examples/network/secureudpclient/mainwindow.cpp +++ b/examples/network/secureudpclient/mainwindow.cpp @@ -83,7 +83,7 @@ void MainWindow::on_connectButton_clicked() return startNewConnection(remoteAddress); addInfoMessage(tr("Looking up the host ...")); - lookupId = QHostInfo::lookupHost(hostName, this, SLOT(lookupFinished(QHostInfo))); + lookupId = QHostInfo::lookupHost(hostName, this, &MainWindow::lookupFinished); updateUi(); } diff --git a/examples/network/torrent/ratecontroller.cpp b/examples/network/torrent/ratecontroller.cpp index c5e33ab63c8..338bb596c9a 100644 --- a/examples/network/torrent/ratecontroller.cpp +++ b/examples/network/torrent/ratecontroller.cpp @@ -42,7 +42,7 @@ void RateController::scheduleTransfer() if (transferScheduled) return; transferScheduled = true; - QTimer::singleShot(50, this, SLOT(transfer())); + QTimer::singleShot(50, this, &RateController::transfer); } void RateController::transfer() diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp index b82442b8c08..fc1849c2216 100644 --- a/examples/network/torrent/trackerclient.cpp +++ b/examples/network/torrent/trackerclient.cpp @@ -20,7 +20,7 @@ TrackerClient::TrackerClient(TorrentClient *downloader, QObject *parent) void TrackerClient::start(const MetaInfo &info) { metaInfo = info; - QTimer::singleShot(0, this, SLOT(fetchPeerList())); + QTimer::singleShot(0, this, &TrackerClient::fetchPeerList); if (metaInfo.fileForm() == MetaInfo::SingleFileForm) { length = metaInfo.singleFile().length;