Simplest data download code doesnt work :(
Hi, i've been trying to understand the network system, but this simple code doesnt work.
please could anybody tell me why??
thanks
Code:
QUrl imgURL
("http://www.convocatoria09.fecyt.es/img/logotipos/logo-ucc-jpg.jpg");
QNetworkAccessManager manager;
QNetworkRequest request(imgURL);
manager.get(request);
connect(&manager, SIGNAL( finished(QNetworkReply*)), SLOT(loadIMG(QNetworkReply*)));
and the loadIMG() function, just a debug
Code:
void loadCover( QNetworkReply* reply ) {
}
Re: Simplest data download code doesnt work :(
loadIMG() != loadCover(). Please post your actual code and don't make one up for the forum. And the problem you are facing is a standard C++ error. You have to create QNetworkAccessManager on the heap, because otherwise it gets destroyed at the end of the scope, thus the signal can never be emitted.
Re: Simplest data download code doesnt work :(
sorry for that error, thats because i was doing some changes while was posting , and thanks a lot for the reply.
Thanks and sorry for bothering.