source: src/model/eventmodel.h @ f0ce4d0

qt5
Last change on this file since f0ce4d0 was 72f6fe4, checked in by pavelpa <pavelpa@…>, 13 years ago

implemented xml parser

  • parsing Schedule
  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[d0d0a66]1#ifndef EVENTMODEL_H
2#define EVENTMODEL_H
3
4#include <QAbstractItemModel>
5
6#include "event.h"
7
8class EventModel : public QAbstractItemModel
9{
10public:
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;
[72f6fe4]17    void reload(); // reloads Events from the DB
[d0d0a66]18
19private:
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
35private:
36    void createTimeGroups();
37
38private:
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.