#include #include #include #include #include #include "tariff_editor.h" int main(int argc, char **argv) { Q_UNUSED(argc); Q_UNUSED(argv); TariffEditor editor; editor.writeToDocument("Project", "Szeged"); editor.writeToDocument("Version", "1.0.0"); editor.writeToDocument("Date", "01.01.1970"); editor.writeToDocument("Commiter" , ""); editor.writeToDocument("Info", ""); editor.writeToDocument(editor.create("TariffType")); editor.writeToDocument(editor.create("TariffAccuracy")); editor.writeToDocument(editor.create("TariffPrice")); editor.writeToDocument(editor.create("TariffProducts")); editor.writeToDocument(editor.create("TariffConfig")); editor.writeToDocument(editor.create("TimeRanges")); qCritical().noquote() << editor.document().toJson(); return 0; QFile currentFile("/home/linux/ATBTariffCalculator/Utilities/tariff.template.json"); if (currentFile.open(QIODevice::ReadOnly)) { qCritical() << __LINE__; QByteArray json = currentFile.readAll(); QJsonParseError e; QJsonDocument doc = QJsonDocument::fromJson(json, &e); if (e.error == QJsonParseError::NoError) { qCritical().noquote() << doc.toJson(QJsonDocument::JsonFormat::Indented); } else { qCritical() << e.errorString(); } } return 0; }