qt5
Last change
on this file since 72f6fe4 was
72f6fe4,
checked in by pavelpa <pavelpa@…>, 13 years ago
|
implemented xml parser
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | #ifndef EVENTMODEL_H |
---|
2 | #define EVENTMODEL_H |
---|
3 | |
---|
4 | #include <QAbstractItemModel> |
---|
5 | |
---|
6 | #include "event.h" |
---|
7 | |
---|
8 | class EventModel : public QAbstractItemModel |
---|
9 | { |
---|
10 | public: |
---|
11 | EventModel(); |
---|
12 | QVariant data(const QModelIndex& index, int role) const; |
---|
13 | QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; |
---|
14 | QModelIndex parent ( const QModelIndex & index ) const; |
---|
15 | int columnCount ( const QModelIndex & parent = QModelIndex() ) const; |
---|
16 | int rowCount ( const QModelIndex & parent = QModelIndex() ) const; |
---|
17 | void reload(); // reloads Events from the DB |
---|
18 | |
---|
19 | private: |
---|
20 | struct Group |
---|
21 | { |
---|
22 | Group(const QString & title, |
---|
23 | int firstEventIndex) : |
---|
24 | |
---|
25 | mTitle(title), |
---|
26 | mFirstEventIndex(firstEventIndex), |
---|
27 | mChildCount(0) |
---|
28 | {} |
---|
29 | |
---|
30 | QString mTitle; |
---|
31 | int mFirstEventIndex; |
---|
32 | int mChildCount; |
---|
33 | }; |
---|
34 | |
---|
35 | private: |
---|
36 | void createTimeGroups(); |
---|
37 | |
---|
38 | private: |
---|
39 | QList<Event> mEvents; |
---|
40 | QList<Group> mGroups; |
---|
41 | QHash<int, int> mParents; |
---|
42 | }; |
---|
43 | |
---|
44 | #endif // EVENTMODEL_H |
---|
Note: See
TracBrowser
for help on using the repository browser.