Items can be added to model dynamically.
This commit is contained in:
23
formats/jsonparser.h
Normal file
23
formats/jsonparser.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef JSONPARSER_H
|
||||
#define JSONPARSER_H
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
class QJsonObject;
|
||||
class QString;
|
||||
class QByteArray;
|
||||
class QJsonArray;
|
||||
|
||||
class JsonParser {
|
||||
public:
|
||||
static QList<QHash<int, QVariant>> toItemValuesList(const QByteArray& jsonData,
|
||||
const QString& objectName = "");
|
||||
|
||||
private:
|
||||
explicit JsonParser();
|
||||
|
||||
static QJsonArray extractItemArray(const QByteArray& jsonData, const QString& objectName);
|
||||
static QHash<int, QVariant> jsonObjectToItemValues(const QJsonObject& itemJsonObject);
|
||||
};
|
||||
|
||||
#endif // JSONPARSER_H
|
||||
Reference in New Issue
Block a user