PDA

View Full Version : Store several "QNetworkReply" in a QMap !



fitzy
29th November 2009, 11:24
Hi there !

I'm trying to store several "QNetworkReply" in a QMap.

Here is my code :



QMap<int,QNetworkReply*> *replies;
QNetworkReply *rep;
rep = manager->get(request); // Works
replies->insert(0, rep); // WRONG PART


But it does not work ! :confused:

Lykurg
29th November 2009, 11:27
create your map on the stack or create one with new! And for further questions you might want use our Newbie section. We are going to help you also there...

squidge
29th November 2009, 11:32
The memory for 'replies' is not allocated, it seems. Drop the star, and use replies.insert rather than replies->insert.

fitzy
29th November 2009, 11:50
Oh yeah, sure !

Thank you.