Hi chris and anda,
Now I changed the code by changing the first argument to QNEtworkaccessManager
and I am not getting any warnings from the complier
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
QObject::connect(manager,
SIGNAL(QNetworkAccessManager
::finished(QNetworkReply
*)),
this,
SLOT(replyFinish
(QNetworkReply
*)));
manager->get(QNetworkRequest(url));
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
QObject::connect(manager,SIGNAL(QNetworkAccessManager::finished(QNetworkReply*)),this,SLOT(replyFinish(QNetworkReply*)));
manager->get(QNetworkRequest(url));
To copy to clipboard, switch view to plain text mode
and I am testing if the ReplyFinsh() is executing by creating a message box to display as soon as the control goes to slot
void USGSDialog::replyFinish(QNetworkReply* reply)
{
rep->setText("Inside Reply Finmsih");
rep->show();
if(reply->isOpen()){
input.setData(reply->readAll());
doc.setContent(input.data());
// Get the root element
// Get Data
getData(root);
if(reply->isFinished())
reply->close();
}
if(reply->error() != QNetworkReply::NoError){
QString err
= reply
->errorString
();
error->setText(err);
error->show();
}
}
void USGSDialog::replyFinish(QNetworkReply* reply)
{
QMessageBox* rep = new QMessageBox();
rep->setText("Inside Reply Finmsih");
rep->show();
if(reply->isOpen()){
QXmlInputSource input;
input.setData(reply->readAll());
QDomDocument doc;
doc.setContent(input.data());
// Get the root element
QDomElement root = doc.firstChildElement();
// Get Data
getData(root);
if(reply->isFinished())
reply->close();
}
if(reply->error() != QNetworkReply::NoError){
QString err = reply->errorString();
QMessageBox* error = new QMessageBox();
error->setText(err);
error->show();
}
}
To copy to clipboard, switch view to plain text mode
Still I dont get the slot working.
Bookmarks