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 QML_ELEMENT
13 QML_SINGLETON
14
15 Q_PROPERTY(qint64 collectionId READ collectionId WRITE setCollectionId NOTIFY collectionIdChanged)
16 Q_PROPERTY(QStringList tags READ tags WRITE setTags NOTIFY tagsChanged)
17 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
18
19public:
20 qint64 collectionId() const;
21 QStringList tags() const;
22 QString name() const;
23
24public Q_SLOTS:
25 void setCollectionId(const qint64 collectionId);
26 void setTags(const QStringList tags);
27 void setName(const QString &name);
28
29 void toggleFilterTag(const QString tagName);
30 void reset();
31 void removeTag(const QString &tagName);
32
34 void collectionIdChanged();
35 void tagsChanged();
36 void nameChanged();
37
38private:
39 qint64 m_collectionId = -1;
40 QStringList m_tags;
41 QString m_name;
42};
void setName(const QString &name)
Definition filter.cpp:39
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:35:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.