1 #ifndef JSONTREEMODEL_H
2 #define JSONTREEMODEL_H
4 #include <QAbstractItemModel>
8 #include <nlohmann/json.hpp>
10 using namespace nlohmann::detail;
22 QVariant data(
const QModelIndex &index,
int role)
const;
23 QVariant headerData(
int section, Qt::Orientation orientation,
24 int role = Qt::DisplayRole)
const;
26 QModelIndex index(
int row,
int column,
27 const QModelIndex &parent = QModelIndex())
const;
28 QModelIndex parent(
const QModelIndex &index)
const;
30 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
31 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
33 Qt::ItemFlags flags(
const QModelIndex &index)
const;
34 bool setData(
const QModelIndex &index,
const QVariant &value,
35 int role = Qt::EditRole);
36 bool setHeaderData(
int section, Qt::Orientation orientation,
37 const QVariant &value,
int role = Qt::EditRole);
39 bool insertColumns(
int position,
int columns,
40 const QModelIndex &parent = QModelIndex());
41 bool removeColumns(
int position,
int columns,
42 const QModelIndex &parent = QModelIndex());
43 bool insertRows(
int position,
int rows,
44 const QModelIndex &parent = QModelIndex());
45 bool removeRows(
int position,
int rows,
46 const QModelIndex &parent = QModelIndex());
52 QString getTypeString(value_t vType);