mobile/statistics: export ChartListModel to QML

For QML, the roles have to be associated dynamically with
name. Moreover, the model has to be registered as a QML
type to make it accessible from QML.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-12 17:53:38 +01:00 committed by Dirk Hohndel
parent e5c30e042b
commit 46bb242c69
3 changed files with 15 additions and 0 deletions

View file

@ -44,6 +44,7 @@ private:
QFont itemFont;
QFont headerFont;
std::vector<Item> items;
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;