| 16 | return QJsonDocument::fromJson(data); |
| 17 | } |
| 18 | static void writeJson(const char *file, QJsonDocument doc) |
| 19 | { |
| 20 | QFile jsonFile(file); |
| 21 | jsonFile.open(QIODevice::WriteOnly | QIODevice::Text); |
| 22 | auto data = doc.toJson(QJsonDocument::Indented); |
| 23 | qDebug() << QString::fromUtf8(data); |
| 24 | jsonFile.write(data); |
| 25 | jsonFile.close(); |
| 26 | } |
| 27 | |
| 28 | private |
| 29 | slots: |