Results 1 to 4 of 4

Thread: A problem about QJson

  1. #1
    Join Date
    May 2013
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Android

    Default A problem about QJson

    A string format is like below, how can I get each item's fs_id, path and so on?

    reply:
    {"list":
    [
    {"fs_id":3791751042,"path":"\/apps\/\u6d4b\u8bd5\u5e94\u7528\/dir1","ctime":1368406204,"mtime":1368406204,"md5": "","size":0,"isdir":1}, {"fs_id":2462243476,"path":"\/apps\/\u6d4b\u8bd5\u5e94\u7528\/lai.png","ctime":1368406651,"mtime":1368406812,"md 5":"92223693b501251e70faf2d03badd19e","size":1333, "isdir":0}
    ],
    "request_id":2688268013
    }

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: A problem about QJson

    Which part of the information at QJSon Usage are you having problems with?

  3. #3
    Join Date
    May 2013
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Android

    Default Re: A problem about QJson

    I don't know how to get the value of each "fs_id".


    Added after 29 minutes:


    The problem is there is a "reply:" at the beginning of the string
    Last edited by greatcl; 14th May 2013 at 07:41.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: A problem about QJson

    You need to correct the input JSON so it is a valid Json object, parse it, and then you can access the QVariantList/QVariantMap structures that result.

Similar Threads

  1. QJson
    By WetCode in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2013, 22:54
  2. QJSON Problem
    By plopes21 in forum Qt Programming
    Replies: 15
    Last Post: 20th June 2012, 15:33
  3. Replies: 0
    Last Post: 8th May 2012, 19:50
  4. Qjson
    By Girija in forum Qt Programming
    Replies: 8
    Last Post: 17th September 2010, 14:19
  5. QJson Windows compile problem
    By skepticalgeek in forum Qt Programming
    Replies: 2
    Last Post: 9th August 2010, 01:15

Tags for this Thread

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.