4d48000558b04e5c65f0b34b3cd83baf040bea88
[buliscores] / src / matchdaymodel.h
1 #ifndef MATCHDAYMODEL_H
2 #define MATCHDAYMODEL_H
3
4 #include <QAbstractTableModel>
5 #include <QFontMetrics>
6 #include <QSettings>
7
8 #include "matchdaybackend.h"
9
10 class MatchDayModel : public QAbstractTableModel
11 {
12     Q_OBJECT
13
14     enum {
15         Spacer = 0,
16         MatchState,
17         Spacer2,
18         HomeIcon,
19         HomeTeam,
20         HomeScore,
21         Seperator,
22         AwayScore,
23         AwayTeam,
24         AwayIcon,
25         Date
26     };
27
28 private:
29     QString          m_url;
30     MatchDayBackend* m_backend;
31     int              m_lastRowCount;
32     QSettings        m_settings;
33
34
35 public:
36     explicit MatchDayModel(QObject *parent, MatchDayBackend* backend);
37
38     int rowCount(const QModelIndex& index) const;
39     int columnCount(const QModelIndex& index) const;
40     QVariant data(const QModelIndex& index, int role) const;
41
42 protected slots:
43     void onUpdateFinished(void);
44
45 };
46
47 #endif // MATCHDAYMODEL_H