Given unnamed JSON document:
[
{
},
{
},
]
Qt 5.10+ has operator[]
for QJsonDocument, so we can address any of them by index:
json_doc[1];
How does one do the same in older versions of Qt?
Given unnamed JSON document:
[
{
},
{
},
]
Qt 5.10+ has operator[]
for QJsonDocument, so we can address any of them by index:
json_doc[1];
How does one do the same in older versions of Qt?
In your particular example the Json document is represented by a Json array. You might get it like:
if (document.isArray() {
auto a = document.array();
// TODO: check the array size before
auto v = a[0];
}