Help parse this json:
{ "meta": { "v":"1.2" ,"p":"259355195" ,"a":103 ,"t":"aaaaaaa" ,"d":1443729008 } ,"data": [ {"i":78585,"f":103,"t":"сообщение1","d":299977900} ,{"i":78584,"f":259,"t":"сообщение2","d":299975624} ,{...} , ... ,{...} ] } Those. The data array contains a large number of objects. I use Qt 4.8.6 and the QJson library. It is not clear how to go through the array of objects and parse each of them. Another problem arises in the fact that if the size of the json file is more than 100 kB, the parser does not work (the file that I need to parse takes about 300 kB). What can be done with this?
Update
errorString() returns an empty string, but at the same time if I try to output to qDebug()
QVariantMap result = jsonParser.parse(sJson.toLocal8Bit(), &ok).toMap(); qDebug() << result["t"].toString(); That gets also an empty string.
errorString()returnerrorString()parser object, when, in fact, parsing fails with an error? - alexis031182t, you need to run:jsonParser.parse(sJson.toLocal8Bit(), &ok).toMap().value("meta").toMap().value("t").toString();- alexis031182sJson.toUtf8(). - alexis031182