diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-03 13:49:56 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-03 13:56:58 +0200 |
commit | 2085b83960cbb8e4693cf48a5bd265aa946256de (patch) | |
tree | 58f5d6f7ff18cd63ac0aa8827dadfbb66e269083 /framework/src/domain/perioddayeventmodel.h | |
parent | 064367aec304708591f5cd4d010ed462119a0323 (diff) | |
download | kube-2085b83960cbb8e4693cf48a5bd265aa946256de.tar.gz kube-2085b83960cbb8e4693cf48a5bd265aa946256de.zip |
Weekview with calendar colors
Diffstat (limited to 'framework/src/domain/perioddayeventmodel.h')
-rw-r--r-- | framework/src/domain/perioddayeventmodel.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/framework/src/domain/perioddayeventmodel.h b/framework/src/domain/perioddayeventmodel.h index a7d9cea8..a0410e2e 100644 --- a/framework/src/domain/perioddayeventmodel.h +++ b/framework/src/domain/perioddayeventmodel.h | |||
@@ -78,6 +78,8 @@ | |||
78 | // | '--- List of event pointers for that day | 78 | // | '--- List of event pointers for that day |
79 | // '--- Partition / day | 79 | // '--- Partition / day |
80 | // | 80 | // |
81 | |||
82 | class EntityCacheInterface; | ||
81 | class KUBE_EXPORT PeriodDayEventModel : public QAbstractItemModel | 83 | class KUBE_EXPORT PeriodDayEventModel : public QAbstractItemModel |
82 | { | 84 | { |
83 | Q_OBJECT | 85 | Q_OBJECT |
@@ -87,6 +89,7 @@ class KUBE_EXPORT PeriodDayEventModel : public QAbstractItemModel | |||
87 | 89 | ||
88 | public: | 90 | public: |
89 | using Event = Sink::ApplicationDomain::Event; | 91 | using Event = Sink::ApplicationDomain::Event; |
92 | using Calendar = Sink::ApplicationDomain::Calendar; | ||
90 | 93 | ||
91 | enum Roles | 94 | enum Roles |
92 | { | 95 | { |
@@ -96,6 +99,7 @@ public: | |||
96 | Description, | 99 | Description, |
97 | StartTime, | 100 | StartTime, |
98 | Duration, | 101 | Duration, |
102 | Color | ||
99 | }; | 103 | }; |
100 | Q_ENUM(Roles); | 104 | Q_ENUM(Roles); |
101 | PeriodDayEventModel(QObject *parent = nullptr); | 105 | PeriodDayEventModel(QObject *parent = nullptr); |
@@ -120,6 +124,7 @@ public: | |||
120 | private: | 124 | private: |
121 | void updateQuery(); | 125 | void updateQuery(); |
122 | void partitionData(); | 126 | void partitionData(); |
127 | QByteArray getColor(const QByteArray &calendar) const; | ||
123 | 128 | ||
124 | int bucketOf(const QDate &candidate) const; | 129 | int bucketOf(const QDate &candidate) const; |
125 | 130 | ||
@@ -128,6 +133,7 @@ private: | |||
128 | 133 | ||
129 | QSharedPointer<QAbstractItemModel> eventModel; | 134 | QSharedPointer<QAbstractItemModel> eventModel; |
130 | QVector<QList<QSharedPointer<Event>>> partitionedEvents; | 135 | QVector<QList<QSharedPointer<Event>>> partitionedEvents; |
136 | QSharedPointer<EntityCacheInterface> mCalendarCache; | ||
131 | 137 | ||
132 | static const constexpr quintptr DAY_ID = std::numeric_limits<quintptr>::max(); | 138 | static const constexpr quintptr DAY_ID = std::numeric_limits<quintptr>::max(); |
133 | }; | 139 | }; |