Using the typedef ModelItemValues for "QHash<int, QVariant>".
This commit is contained in:
@ -8,20 +8,22 @@ class QString;
|
||||
class QByteArray;
|
||||
class QJsonArray;
|
||||
|
||||
typedef QHash<int, QVariant> ModelItemValues;
|
||||
|
||||
using namespace std;
|
||||
|
||||
class JsonParser {
|
||||
public:
|
||||
static QList<QHash<int, QVariant>> toItemValuesList(const QByteArray& jsonData,
|
||||
const QString& objectName = "");
|
||||
static QByteArray itemValuesListToJson(const QList<QHash<int, QVariant>>& itemValuesList,
|
||||
static QList<ModelItemValues> toItemValuesList(const QByteArray& jsonData,
|
||||
const QString& objectName = "");
|
||||
static QByteArray itemValuesListToJson(const QList<ModelItemValues>& itemValuesList,
|
||||
const QString& objectName = "");
|
||||
|
||||
private:
|
||||
explicit JsonParser();
|
||||
|
||||
static QJsonArray extractItemArray(const QByteArray& jsonData, const QString& objectName);
|
||||
static QHash<int, QVariant> jsonObjectToItemValues(const QJsonObject& itemJsonObject);
|
||||
static ModelItemValues jsonObjectToItemValues(const QJsonObject& itemJsonObject);
|
||||
|
||||
static pair<int, QVariant> getKeyValuePair(const QJsonObject& itemJsonObject, const int role);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user