#include <QtNetwork>
void myClass
::startRequest(QUrl url,
bool urlType
) {
QNetworkRequest request;
request.
setUrl(QUrl(url
));
request.setRawHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Firefox/31.0");
reply = qnam.get(request);
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
connect(reply, SIGNAL(finished()), this, SLOT(httpFinished2()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(httpError(QNetworkReply::NetworkError)));
}
#include <QtNetwork>
void myClass::startRequest(QUrl url,bool urlType)
{
QNetworkRequest request;
request.setUrl(QUrl(url));
request.setRawHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Firefox/31.0");
reply = qnam.get(request);
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
connect(reply, SIGNAL(finished()), this, SLOT(httpFinished2()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(httpError(QNetworkReply::NetworkError)));
}
To copy to clipboard, switch view to plain text mode
Bookmarks