Results 1 to 4 of 4

Thread: Store several "QNetworkReply" in a QMap !

  1. #1
    Join Date
    Oct 2009
    Posts
    38
    Thanks
    13
    Platforms
    Unix/X11 Windows

    Default Store several "QNetworkReply" in a QMap !

    Hi there !

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

    Here is my code :

    Qt Code:
    1. QMap<int,QNetworkReply*> *replies;
    2. QNetworkReply *rep;
    3. rep = manager->get(request); // Works
    4. replies->insert(0, rep); // WRONG PART
    To copy to clipboard, switch view to plain text mode 

    But it does not work !

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Store several "QNetworkReply" in a QMap !

    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...

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Store several "QNetworkReply" in a QMap !

    The memory for 'replies' is not allocated, it seems. Drop the star, and use replies.insert rather than replies->insert.

  4. The following user says thank you to squidge for this useful post:

    fitzy (29th November 2009)

  5. #4
    Join Date
    Oct 2009
    Posts
    38
    Thanks
    13
    Platforms
    Unix/X11 Windows

    Default Re: Store several "QNetworkReply" in a QMap !

    Oh yeah, sure !

    Thank you.

Similar Threads

  1. Replies: 11
    Last Post: 21st May 2012, 05:02
  2. QMap to keep the model statistcs
    By gyre in forum Newbie
    Replies: 14
    Last Post: 10th December 2007, 18:18
  3. QMap model data
    By gyre in forum Newbie
    Replies: 3
    Last Post: 9th December 2007, 22:19
  4. QMap Problem with arguments.
    By ankurjain in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2006, 12:12
  5. QMap destructor bug
    By Ruud in forum Qt Programming
    Replies: 6
    Last Post: 8th April 2006, 09:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.