63
68
QNetworkAccessManager* manager = new QNetworkAccessManager();
65
70
QNetworkRequest request(url_);
67
76
QNetworkReply* reply = manager->get(request);
69
connect(manager, &QNetworkAccessManager::finished, this, &HttpClientQtThread::got_reply, Qt::DirectConnection);
79
connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(got_reply(QNetworkReply *)));
80
connect(reply, SIGNAL(readyRead()), this, SLOT(dataReady()));
70
81
connect(this, &HttpClientQtThread::abort, reply, &QNetworkReply::abort);
73
84
timeout.singleShot(timeout_, this, SLOT(timeout()));
74
85
QThread::exec(); // enter event loop
80
91
void HttpClientQtThread::cancel()