4 #include <QAbstractItemModel>
8 class EventModel : public QAbstractItemModel
11 static const QString COMMA_SEPARATOR;
14 QVariant data(const QModelIndex& index, int role) const;
15 QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
16 QModelIndex parent ( const QModelIndex & index ) const;
17 int columnCount ( const QModelIndex & parent = QModelIndex() ) const;
18 int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
19 void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB
20 void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB
21 void loadEventsByActivities(const QDate &aDate, int aConferenceId); // loads Events grouped by Activities from the DB
22 // a method to force 'EventModel' emit signal 'dataChanged()'
23 // a 'view', eg. 'TreeView' listens for this signal and redraws changed items(indexes)
24 void emitDataChangedSignal(const QModelIndex &aTopLeft, const QModelIndex &aBottomRight);
29 Group(const QString & title,
30 int firstEventIndex) :
33 mFirstEventIndex(firstEventIndex),
43 void createTimeGroups();
44 void createActivityGroups();
50 QHash<int, int> mParents;
53 #endif // EVENTMODEL_H