Bump version to 0.2.2
[harbour-pedalo.git] / src / statsmodel.h
1 #ifndef STATSMODEL_H
2 #define STATSMODEL_H
3
4 #include <QAbstractListModel>
5 #include <QStringList>
6
7 #include "stats.h"
8
9 class StatsModel : public QAbstractListModel
10 {
11 Q_OBJECT
12 public:
13 enum StatsRoles {
14 TitleRole = Qt::UserRole + 1,
15 BarValuesRole,
16 LineValuesRole,
17 LabelsRole,
18 UnitsRole,
19 MinValRole,
20 MaxValRole,
21 StepRole,
22 };
23
24 QHash<int, QByteArray> roleNames() const;
25
26 StatsModel(QObject *parent = 0);
27
28 void addStats(Stats &stats);
29
30 int rowCount(const QModelIndex & parent = QModelIndex()) const;
31
32 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
33
34 void clear();
35
36 Q_INVOKABLE void updateAll();
37
38 private:
39 QHash<int, QByteArray> roles;
40 QList<Stats *> stats;
41 int visibleIndex;
42 };
43
44 #endif // STATSMODEL_H