const QString url
= "http://127.0.0.6/checkpoint.php";
QNetworkRequest request;
request.
setUrl(QUrl(url
));
request.setRawHeader("User-Agent", "MyOwnBrowser 1.0");
qDebug("running");
manager = new QNetworkAccessManager(this);
QNetworkReply *reply = manager->get(request);
QObject::connect(reply,
SIGNAL(readyRead
()),
this,
SLOT(slotReadyRead
()));
QObject::connect(manager,
SIGNAL(finished
(QNetworkReply
*)),
this,
SLOT(replyHasFinished
()));
QObject::connect(reply,
SIGNAL(error
(QNetworkReply
::NetworkError)),
this,
SLOT(slotError
(QNetworkReply
::NetworkError)));
QObject::connect(reply,
SIGNAL(sslErrors
(QList<QSslError>
)),
this,
SLOT(slotSslErrors
(QList<QSslError>
)));
....
void MyClass::replyHasFinished(){
AfxMessageBox(_T("replyHasFinished WORKS"));
}
const QString url= "http://127.0.0.6/checkpoint.php";
QNetworkRequest request;
request.setUrl(QUrl(url));
request.setRawHeader("User-Agent", "MyOwnBrowser 1.0");
qDebug("running");
manager = new QNetworkAccessManager(this);
QNetworkReply *reply = manager->get(request);
QObject::connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
QObject::connect(manager, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyHasFinished()));
QObject::connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),this, SLOT(slotError(QNetworkReply::NetworkError)));
QObject::connect(reply, SIGNAL(sslErrors(QList<QSslError>)),this, SLOT(slotSslErrors(QList<QSslError>)));
....
void MyClass::replyHasFinished(){
AfxMessageBox(_T("replyHasFinished WORKS"));
}
To copy to clipboard, switch view to plain text mode
Bookmarks