21 #ifndef INDICATORSMODEL_H
22 #define INDICATORSMODEL_H
24 #include "indicator.h"
25 #include "unityindicatorsglobal.h"
27 #include <QAbstractListModel>
30 class IndicatorsManager;
32 class UNITYINDICATORS_EXPORT IndicatorsModel :
public QAbstractListModel
36 Q_PROPERTY(
int count READ count NOTIFY countChanged)
37 Q_PROPERTY(QString profile READ profile WRITE setProfile NOTIFY profileChanged)
41 IndicatorsModel(QObject *parent=0);
44 Q_INVOKABLE
void load();
45 Q_INVOKABLE
void unload();
47 Q_INVOKABLE QVariant data(
int row,
int role) const;
49 QString profile() const;
50 void setProfile(const QString& profile);
53 QHash<
int, QByteArray> roleNames() const override;
54 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
55 QVariant data(const QModelIndex &index,
int role = Qt::DisplayRole) const override;
56 QModelIndex parent (const QModelIndex &index) const override;
57 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
62 void profileChanged();
63 void indicatorDataChanged(const QVariant& data);
66 void onIdentifierChanged();
67 void onIndicatorPropertiesChanged();
68 void onIndicatorLoaded(const QString& indicator);
69 void onIndicatorAboutToBeUnloaded(const QString& indicator);
72 IndicatorsManager *m_manager;
74 QList<Indicator::Ptr> m_indicators;
76 void notifyDataChanged(QObject *sender,
int role);
80 #endif // INDICATORSMODEL_H