source: src/mvc/eventmodel.h @ 6f39595

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

started work on 'favourities'

  • created tavourities tree view in the MainWindow? 'Favourities' tab
  • listed some testing 'fav' events
  • TODO: list isn't updated dynamically, which means that the list isn't updated if the user adds/removes an event(s) to/from the 'favourities' list
  • Property mode set to 100644
File size: 1.2 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;
[969a840]17    void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB
[6f39595]18    void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB
[d0d0a66]19
20private:
21    struct Group
22    {
23        Group(const QString & title,
24              int firstEventIndex) :
25
26            mTitle(title),
27            mFirstEventIndex(firstEventIndex),
28            mChildCount(0)
29        {}
30
31        QString mTitle;
32        int mFirstEventIndex;
33        int mChildCount;
34    };
35
36private:
37    void createTimeGroups();
38
39private:
40    QList<Event> mEvents;
41    QList<Group> mGroups;
42    QHash<int, int> mParents;
43};
44
45#endif // EVENTMODEL_H
[69393c0]46
Note: See TracBrowser for help on using the repository browser.