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
qqmlvaluefilter_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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
4#ifndef QQMLVALUEFILTER_P_H
5#define QQMLVALUEFILTER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQmlModels/private/qqmlrolefilter_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQmlSortFilterProxyModel;
24
25class Q_QMLMODELS_EXPORT QQmlValueFilter : public QQmlRoleFilter
26{
27 Q_OBJECT
28 Q_PROPERTY(QVariant value READ value WRITE setValue RESET resetValue NOTIFY valueChanged)
29 QML_NAMED_ELEMENT(ValueFilter)
30 QML_ADDED_IN_VERSION(6, 10)
31
32public:
33 explicit QQmlValueFilter(QObject *parent = nullptr);
34 ~QQmlValueFilter() = default;
35
36 const QVariant& value() const;
37 void setValue(const QVariant& value);
38 void resetValue();
39
40 bool filterAcceptsRowInternal(int row, const QModelIndex& sourceIndex, const QQmlSortFilterProxyModel *) const override;
41
42Q_SIGNALS:
43 void valueChanged();
44
45private:
46 Q_DECLARE_PRIVATE(QQmlValueFilter)
47};
48
50{
51 Q_DECLARE_PUBLIC (QQmlValueFilter)
52
53public:
55};
56
57QT_END_NAMESPACE
58
59#endif // QQMLVALUEFILTER_P_H