QJsonObject mainObject;
mainObject.insert("Version", "1.0");
mainObjecti.insert("tap", QJsonObject());
mainObjecti.insert("notation", QJsonObject());
QJsonObject definition1;
definition1.insert("tag", 1);
definition1.insert("Name", "view1");
QJsonObject definition2;
definition2.insert("tag", 2);
definition2.insert("Name", "view2");
QJsonArray definition;
defintion.append(definition1);
defintion.append(definition2);
mainObject.insert("definition", definition);
QJsonObject images;
images.insert("File", "image.png");
images.insert("Index", 0);
images.insert("Properties", QJsonArray{"black", "bold"});
mainObject.insert("images", images);
QJsonDocument document(mainObject);
QByteArray jsonData
= document.
toJson(QJsonDocument
::Indented);
QJsonObject mainObject;
mainObject.insert("Version", "1.0");
mainObjecti.insert("tap", QJsonObject());
mainObjecti.insert("notation", QJsonObject());
QJsonObject definition1;
definition1.insert("tag", 1);
definition1.insert("Name", "view1");
QJsonObject definition2;
definition2.insert("tag", 2);
definition2.insert("Name", "view2");
QJsonArray definition;
defintion.append(definition1);
defintion.append(definition2);
mainObject.insert("definition", definition);
QJsonObject images;
images.insert("File", "image.png");
images.insert("Index", 0);
images.insert("Properties", QJsonArray{"black", "bold"});
mainObject.insert("images", images);
QJsonDocument document(mainObject);
QByteArray jsonData = document.toJson(QJsonDocument::Indented);
To copy to clipboard, switch view to plain text mode
Bookmarks