Results 1 to 10 of 10

Thread: Traversing QVariantMap

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Feb 2013
    Posts
    50
    Thanks
    5

    Default Re: Traversing QVariantMap

    I didn't check that one, but I removed this code which I had before the code I posted above:
    // printf(reply->readAll());
    // mFile->write(reply->readAll());
    // mFile->flush();
    // mFile->close();
    and now the QByteArray I mentioned above seems to be correctly initialized -- strange huh ???

    And please also one thing. As I mentioned the reply contains json data. It seems, there is one key
    first, say "some key" and it's value could be a QVariant which may contain other nested QVariantMaps etc.

    My question is imagine I want to get the value of key which is located inside the nested QVariantMaps. How do I do this??

    For example, I have qDebug()<<"forename: "<<results.value("forename").toString(); but it returns an empty string.
    But as I said I think this maybe because "forename" is a key in one of the nested QVariantMaps inside the "results"
    How to behave in this case? Thank you very much.
    Last edited by ggdev001; 7th February 2013 at 12:47.

Similar Threads

  1. Replies: 0
    Last Post: 10th December 2011, 11:17
  2. Replies: 0
    Last Post: 16th May 2010, 17:53
  3. Traversing QTableView
    By junxuan in forum Qt Programming
    Replies: 2
    Last Post: 1st August 2009, 18:44
  4. QVariant, QVariantMap, and QFileInfoList
    By themolecule in forum Qt Programming
    Replies: 2
    Last Post: 13th September 2007, 07:00
  5. Traversing a QTreeWidget
    By johnny_sparx in forum Newbie
    Replies: 5
    Last Post: 26th March 2006, 09:32

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
  •  
Qt is a trademark of The Qt Company.