- better size calculation
[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 "backendkicker.h"
9
10 class MatchDayModel : public QAbstractTableModel
11 {
12     Q_OBJECT
13
14     enum {
15         HomeIcon  = 0,
16         HomeTeam  = 1,
17         HomeScore = 2,
18         Seperator = 3,
19         AwayScore = 4,
20         AwayTeam  = 5,
21         AwayIcon  = 6,
22         Date      = 7
23     };
24
25 private:
26     QString         m_url;
27     BackendKicker*  m_backend;
28     int             m_lastRowCount;
29     QSettings       m_settings;
30
31
32 public:
33     explicit MatchDayModel(QObject *parent = 0);
34
35     int rowCount(const QModelIndex& index) const;
36     int columnCount(const QModelIndex& index) const;
37     QVariant data(const QModelIndex& index, int role) const;
38
39 protected slots:
40     void onMatchListChanged(void);
41
42 public slots:
43     void update(void);
44
45 };
46
47 #endif // MATCHDAYMODEL_H