source: src/model/eventmodel.h @ 69393c0

qt5
Last change on this file since 69393c0 was 69393c0, checked in by pavelpa <pavelpa@…>, 12 years ago

implemented 'conference' record for accessing info about the conference

  • events are loaded from the first day of the conference
  • Property mode set to 100644
File size: 1.1 KB
Line 
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;
17    void loadEvents(); // loads Events from the DB
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    QDate mCurrentDate;
43    int mConfId;
44};
45
46#endif // EVENTMODEL_H
47
Note: See TracBrowser for help on using the repository browser.