-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonthheadermodel.h
More file actions
56 lines (42 loc) · 1.21 KB
/
Copy pathmonthheadermodel.h
File metadata and controls
56 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef MONTHHEADERMODEL_H
#define MONTHHEADERMODEL_H
#include <QDate>
#include "database.h"
class MonthHeaderModel
{
public:
struct SHeaderItem
{
SHeaderItem() : hasChilds(false), hasParent(false), lvl(0), span(1), id(-1), flags(DataBase::eNone) {}
QString name;
bool hasChilds;
bool hasParent;
QDate removed;
int lvl;
int span;
int id;
quint64 flags;
};
MonthHeaderModel(int year = QDate::currentDate().year(), DataBase::SScore* scores = NULL);
virtual ~MonthHeaderModel() {};
int scoreId(int row, int col) const;
int span(int row, int col) const;
QString data(int row, int col) const;
const SHeaderItem& item(int row, int col) const;
int columnCount() const;
int rowCount() const;
QStringList headers() const { return m_headers; };
int year() const { return m_year; }
private:
int _build(const DataBase::SScore& root, int lvl = 0);
DataBase::SScore* m_scores;
int m_year;
QDate m_start;
QDate m_end;
SHeaderItem m_nullItem;
std::vector<std::vector<SHeaderItem> > m_table;
QStringList m_headers;
int m_height;
int m_width;
};
#endif // MONTHHEADERMODEL_H