MauiKit Calendar

colorproxymodel.h
1// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
2// SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@gmail.com>
3// SPDX-License-Identifier: GPL-2.0-or-later
4
5#pragma once
6
7#include <Akonadi/EntityTreeModel>
8#include <QColor>
9#include <QSortFilterProxyModel>
10
11/// Despite the name, this handles the presentation of collections including display text and icons, not just colors.
13{
15
16public:
17 enum Roles {
19 };
20 Q_ENUM(Roles);
21
22 explicit ColorProxyModel(QObject *parent = nullptr);
23 QVariant data(const QModelIndex &index, int role) const override;
24 Qt::ItemFlags flags(const QModelIndex &index) const override;
25 QHash<int, QByteArray> roleNames() const override;
26 QColor getCollectionColor(Akonadi::Collection collection) const;
27 QColor color(Akonadi::Collection::Id collectionId) const;
28 void setColor(Akonadi::Collection::Id collectionId, const QColor &color);
29
30 void setStandardCollectionId(Akonadi::Collection::Id standardCollectionId);
31
32private:
33 mutable bool mInitDefaultCalendar;
35 Akonadi::Collection::Id m_standardCollectionId = -1;
36};
Despite the name, this handles the presentation of collections including display text and icons,...
Q_OBJECTQ_OBJECT
QObject * parent() const const
T qobject_cast(QObject *object)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:50:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.