Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlrangefilter_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQMLRANGEFILTER_P_H
6#define QQMLRANGEFILTER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQmlModels/private/qqmlrolefilter_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQmlSortFilterProxyModel;
25
26class Q_QMLMODELS_EXPORT QQmlRangeFilter : public QQmlRoleFilter
27{
28 Q_OBJECT
29 Q_PROPERTY(QVariant minimum READ minimum WRITE setMinimum RESET resetMinimum NOTIFY minimumChanged)
30 Q_PROPERTY(QVariant maximum READ maximum WRITE setMaximum RESET resetMaximum NOTIFY maximumChanged)
31 QML_NAMED_ELEMENT(RangeFilter)
32 QML_ADDED_IN_VERSION(6, 12)
33
34public:
35 struct RangeExclusiveBoundary
36 {
37 QVariant value;
38 };
39
40 explicit QQmlRangeFilter(QObject *parent = nullptr);
41 ~QQmlRangeFilter() = default;
42
43 const QVariant &minimum() const;
44 void setMinimum(const QVariant &minimum);
45 void resetMinimum();
46
47 const QVariant &maximum() const;
48 void setMaximum(const QVariant &maximum);
49 void resetMaximum();
50
51 Q_INVOKABLE static QVariant exclusive(const QVariant &value);
52
53 bool filterAcceptsRowInternal(int row, const QModelIndex &sourceParent,
54 const QQmlSortFilterProxyModel *proxyModel) const override;
55
56Q_SIGNALS:
57 void minimumChanged();
58 void maximumChanged();
59
60private:
61 Q_DECLARE_PRIVATE(QQmlRangeFilter)
62};
63
65{
66 Q_DECLARE_PUBLIC(QQmlRangeFilter)
67
68public:
71 bool m_minimumInclusive = true;
72 bool m_maximumInclusive = true;
73};
74
75QT_END_NAMESPACE
76
77Q_DECLARE_METATYPE(QQmlRangeFilter::RangeExclusiveBoundary)
78
79#endif // QQMLRANGEFILTER_P_H