summaryrefslogtreecommitdiffstats
path: root/src/network/doc/snippets/code
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2018-07-26 19:59:00 +0200
committerAndré Hartmann <aha_1980@gmx.de>2018-07-27 12:07:45 +0000
commitc3f2b8b9ea6d384f9903a5ece2aaf1aeb6b8d237 (patch)
treed32110359e0cd0f5e5a8bfc35a9c8bcfd654d8cc /src/network/doc/snippets/code
parent8948491edaf2671187af40287dd1569aa0bee235 (diff)
QNetworkAccessManager: Port doc snippet to functor-connect
Change-Id: I719856168a254c90b0bb0943faee5ab0be75b0bd Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/doc/snippets/code')
-rw-r--r--src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp b/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp
index 873b74363f..aed74e308e 100644
--- a/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qnetworkaccessmanager.cpp
@@ -50,8 +50,8 @@
//! [0]
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
-connect(manager, SIGNAL(finished(QNetworkReply*)),
- this, SLOT(replyFinished(QNetworkReply*)));
+connect(manager, &QNetworkAccessManager::finished,
+ this, &MyClass::replyFinished);
manager->get(QNetworkRequest(QUrl("http://qt-project.org")));
//! [0]
@@ -63,11 +63,11 @@ request.setUrl(QUrl("http://qt-project.org"));
request.setRawHeader("User-Agent", "MyOwnBrowser 1.0");
QNetworkReply *reply = manager->get(request);
-connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
-connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
- this, SLOT(slotError(QNetworkReply::NetworkError)));
-connect(reply, SIGNAL(sslErrors(QList<QSslError>)),
- this, SLOT(slotSslErrors(QList<QSslError>)));
+connect(reply, &QIODevice::readyRead, this, &MyClass::slotReadyRead);
+connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error),
+ this, &MyClass::slotError);
+connect(reply, &QNetworkReply::sslErrors,
+ this, &MyClass::slotSslErrors);
//! [1]
//! [2]