MauiKit Calendar

itemtagsmodel.h
1// SPDX-FileCopyrightText: 2021 Claudio Cambra <claudio.cambra@gmail.com>
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5#include <Akonadi/Item>
6#include <QAbstractListModel>
7#include <QObject>
8
9class ItemTagsModel : public QAbstractListModel
10{
12 Q_PROPERTY(Akonadi::Item item READ item WRITE setItem NOTIFY itemChanged)
13
14public:
15 enum Roles {
16 NameRole = Qt::UserRole + 1,
17 IdRole,
18 };
19 Q_ENUM(Roles);
20
21 explicit ItemTagsModel(QObject *parent = nullptr);
22 ~ItemTagsModel() override = default;
23
24 QVariant data(const QModelIndex &idx, int role) const override;
25 QHash<int, QByteArray> roleNames() const override;
26 int rowCount(const QModelIndex &parent = {}) const override;
27
28 Akonadi::Item item() const;
29 void setItem(Akonadi::Item item);
30
32 void itemChanged();
33
34private:
35 Akonadi::Item m_item;
36};
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.