QNetworckAccessManager & Connecting
I want to download a list of icons for the items of my QStandardItemModel (appsModel). when I do this it does nothing:
for (int i=0; i<appsModel->rowCount(); ++i)
QNetworkRequest request(iconUrl); QNetworkAccessManager *tempManager = new QNetworkAccessManager; tempManager->get(request);
for now the link is the google image but I will set it to the data of items of my model. It's just for testing. what am I doing wrong?
You should also connect the error signal
By the way, why are you re-creating a new QNetworkAccessManager each time ?
My code doesn't work. I can't see how the problem is related to connecting the error signal. can you explain?
And also What do you mean by one QNetworkAccessManager? How can I do that?
That would allow you to know that something wrong happened by at least printing the error on the console.
I mean don't recreate one each time you send a request. Currently you also have a memory leak since you never delete them.
Just add one as a member of your MainWindow class and use it to send all the requests.
Hi, thank you the problem is solved