Initial commit based on GenericQtClient v0.3.0

This commit is contained in:
2026-02-04 19:02:41 +01:00
parent debb462f70
commit b24bda2d95
79 changed files with 5014 additions and 0 deletions

View File

@ -0,0 +1,31 @@
#ifndef JSONPARSER_H
#define JSONPARSER_H
#include <QVariant>
class QJsonObject;
class QString;
class QByteArray;
class QJsonArray;
typedef QMap<int, QVariant> ModelItemValues;
using namespace std;
class JsonParser {
public:
static QList<ModelItemValues> toItemValuesList(const QByteArray& jsonData,
const QString& rootValueName = "");
static QByteArray itemValuesListToJson(const QList<ModelItemValues>& itemValuesList,
const QString& objectName = "");
private:
explicit JsonParser();
static QJsonArray extractItemArray(const QJsonDocument& doc, const QString& objectName);
static ModelItemValues jsonObjectToItemValues(const QJsonObject& itemJsonObject);
static pair<int, QVariant> getKeyValuePair(const QJsonObject& itemJsonObject, const int role);
};
#endif // JSONPARSER_H