21#ifndef INDICATORSMODEL_H
22#define INDICATORSMODEL_H
25#include "lomiriindicatorsglobal.h"
27#include <QAbstractListModel>
30class IndicatorsManager;
32class LOMIRIINDICATORS_EXPORT IndicatorsModel :
public QAbstractListModel
35 Q_PROPERTY(
int count READ count NOTIFY countChanged)
36 Q_PROPERTY(QString profile READ profile WRITE setProfile NOTIFY profileChanged)
39 Q_PROPERTY(
bool light READ light WRITE setLight NOTIFY lightChanged)
43 IndicatorsModel(QObject *parent=
nullptr);
46 Q_INVOKABLE
void load();
47 Q_INVOKABLE
void unload();
49 Q_INVOKABLE QVariant data(
int row,
int role)
const;
51 QString profile()
const;
52 void setProfile(
const QString& profile);
55 void setLight(
const bool &light);
58 QHash<int, QByteArray> roleNames()
const override;
59 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
60 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
61 QModelIndex parent (
const QModelIndex &index)
const override;
62 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
67 void profileChanged();
68 void indicatorDataChanged(
const QVariant& data);
72 void onIdentifierChanged();
73 void onIndicatorPropertiesChanged();
74 void onIndicatorLoaded(
const QString& indicator);
75 void onIndicatorAboutToBeUnloaded(
const QString& indicator);
78 IndicatorsManager *m_manager;
80 QList<Indicator::Ptr> m_indicators;
82 void notifyDataChanged(QObject *sender,
int role);