MauiKit Calendar

filter.h
1// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
2// SPDX-License-Identifier: LGPL-2.0-or-later
3
4#include <QObject>
5#include <QQmlEngine>
6/**
7 * This class is used to enable cross-compatible filtering of data in models.
8 */
9class Filter : public QObject
10{
12 Q_PROPERTY(qint64 collectionId READ collectionId WRITE setCollectionId NOTIFY collectionIdChanged)
13 Q_PROPERTY(QStringList tags READ tags WRITE setTags NOTIFY tagsChanged)
14 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
15
16public:
17 qint64 collectionId() const;
18 QStringList tags() const;
19 QString name() const;
20
21public Q_SLOTS:
22 void setCollectionId(const qint64 collectionId);
23 void setTags(const QStringList tags);
24 void setName(const QString &name);
25
26 void toggleFilterTag(const QString tagName);
27 void reset();
28 void removeTag(const QString &tagName);
29
31 void collectionIdChanged();
32 void tagsChanged();
33 void nameChanged();
34
35private:
36 qint64 m_collectionId = -1;
37 QStringList m_tags;
38 QString m_name;
39};
This class is used to enable cross-compatible filtering of data in models.
Definition filter.h:10
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:48:58 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.