Abdeljalil
24th August 2014, 10:41
Hello,
i want to get a XML file from online source,
example:
http://api.openweathermap.org/data/2.5/weather?q=skikda&mode=xml
how can i download it and store the data in QTemporaryFile or pass it directly to QXmlStreamReader
i tried a lot but i dont know what is the problem exactly
example:
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QNetworkAccessManager *manager = new QNetworkAccessManager;
QNetworkRequest request(QUrl("http://api.openweathermap.org/data/2.5/weather?q=skikda&mode=xml"));
QNetworkReply* reply = manager->get( request) ;
QXmlStreamReader reader( reply );
return a.exec();
}
i want to get a XML file from online source,
example:
http://api.openweathermap.org/data/2.5/weather?q=skikda&mode=xml
how can i download it and store the data in QTemporaryFile or pass it directly to QXmlStreamReader
i tried a lot but i dont know what is the problem exactly
example:
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QNetworkAccessManager *manager = new QNetworkAccessManager;
QNetworkRequest request(QUrl("http://api.openweathermap.org/data/2.5/weather?q=skikda&mode=xml"));
QNetworkReply* reply = manager->get( request) ;
QXmlStreamReader reader( reply );
return a.exec();
}