This is the code :
QEventLoop eventLoop;
QNetworkAccessManager mgr();
QObject::connect(mgr, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));
QUrl url(site);
QNetworkRequest req(url);
QNetworkReply *reply = mgr.get(req);
eventLoop.exec();
if (reply->error() == QNetworkReply::NoError) {
cout << "Success" endl;
delete reply;
}
else {
cout << "Failure" endl;
delete reply;
}
Errors found:
.. \ request.cpp (17): error C2665: 'QObject :: connect': none of 3 overload could convert all kinds of topics
and
.. \ request.cpp (20): error C2228: the element to the left of '.get' must be a class, structure or union