forked from sialan-labs/kaqaz
-
Notifications
You must be signed in to change notification settings - Fork 12
/
papyrushistorymodel.h
46 lines (33 loc) · 983 Bytes
/
papyrushistorymodel.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef PAPYRUSHISTORYMODEL_H
#define PAPYRUSHISTORYMODEL_H
#include <QAbstractListModel>
class PapyrusHistoryModelPrivate;
class PapyrusHistoryModel : public QAbstractListModel
{
Q_OBJECT
Q_ENUMS(HistoryModelRoles)
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
enum HistoryModelRoles {
HistoryDate = Qt::UserRole,
HistoryText,
HistoryPapersCount
};
PapyrusHistoryModel(QObject *parent = 0);
~PapyrusHistoryModel();
int id( const QModelIndex &index ) const;
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QHash<qint32,QByteArray> roleNames() const;
int count() const;
public slots:
void refresh();
signals:
void countChanged();
void datesChanged();
private:
void changed(const QList<int> &list);
private:
PapyrusHistoryModelPrivate *p;
};
#endif // PAPYRUSHISTORYMODEL_H