I want to add more than one QJsonObject
to a QJsonDocument
.
Is this possible?
It should look like this:
[
{
"objID": "obj1"
//... Some other parameter
},
{
"objID": "obj2"
//...Some other parameter
}
]
I tried this:
QJsonDocument(obj1).toJson(QJsonDocument::Compact);
QJsonDocument(obj2).toJson(QJsonDocument::Compact);
But it produces invalid JSON.