PDA

View Full Version : A problem about QJson



greatcl
14th May 2013, 06:32
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,"md5":"92223693b501251e70faf2d03badd19e","size":1333,"isdir":0}
],
"request_id":2688268013
}

ChrisW67
14th May 2013, 07:48
Which part of the information at QJSon Usage (http://qjson.sourceforge.net/usage/) are you having problems with?

greatcl
14th May 2013, 08:41
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

ChrisW67
14th May 2013, 11:20
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.