I have QByteArray,contains this JSON
{"response":
{"count":2,
"items":[
{"name":"somename","key":1"},
{"name":"somename","key":1"}
]}}
Need to parse and get the required data:
QJsonDocument itemDoc = QJsonDocument::fromJson(answer);
QJsonObject itemObject = itemDoc.object();
qDebug()<<itemObject;
QJsonArray itemArray = itemObject["response"].toArray();
qDebug()<<itemArray;
First debug displays the contents of all QByteArray, recorded in itemObject, second debug does not display anything.
Must i parse this otherwise,or why this method does not work?