-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathqmljsonmodel.h
29 lines (26 loc) · 1.34 KB
/
qmljsonmodel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef QMLJSONMODEL_H
#define QMLJSONMODEL_H
#include "jsonmodel.h"
#include "qmljsonmodelcolumn.h"
class QmlJsonModel : public JsonModel, public QQmlParserStatus
{
Q_OBJECT
QML_NAMED_ELEMENT(JsonModel)
Q_CLASSINFO("DefaultProperty", "columnList")
public:
explicit QmlJsonModel(QObject *parent = nullptr);
QList<QmlJsonModelColumn *> m_qmlColumnList;
QQmlListProperty<QmlJsonModelColumn> qmlColumnList();
static void columnList_append(QQmlListProperty<QmlJsonModelColumn> *property, QmlJsonModelColumn *value);
static qsizetype columnList_count(QQmlListProperty<QmlJsonModelColumn> *property);
static QmlJsonModelColumn *columnList_at(QQmlListProperty<QmlJsonModelColumn> *property, qsizetype index);
static void columnList_clear(QQmlListProperty<QmlJsonModelColumn> *property);
static void columnList_replace(QQmlListProperty<QmlJsonModelColumn> *property, qsizetype index, QmlJsonModelColumn *value);
static void columnList_removeLast(QQmlListProperty<QmlJsonModelColumn> *property);
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; //columns compatible
void classBegin() override;
void componentComplete() override;
private:
Q_PROPERTY(QQmlListProperty<QmlJsonModelColumn> columnList READ qmlColumnList CONSTANT FINAL)
};
#endif // QMLJSONMODEL_H