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
qqmlfiltercompositor_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// Qt-Security score:significant reason:default
4
5#ifndef QQMLFILTERCOMPOSITOR_P_H
6#define QQMLFILTERCOMPOSITOR_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/qqmlfilterbase_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQmlSortFilterProxyModel;
25
26class Q_QMLMODELS_EXPORT QQmlFilterCompositor: public QQmlFilterBase
27{
28 Q_OBJECT
29 QML_ANONYMOUS
30 QML_ADDED_IN_VERSION(6, 10)
31
32public:
33 explicit QQmlFilterCompositor(QObject *parent);
34
35 QList<QQmlFilterBase *> filters();
36 QQmlListProperty<QQmlFilterBase> filtersListProperty();
37
38 bool filterAcceptsRowInternal(int, const QModelIndex&, const QQmlSortFilterProxyModel *) const override;
39 bool filterAcceptsColumnInternal(int, const QModelIndex&, const QQmlSortFilterProxyModel *) const override;
40 void updateFilters();
41
42 static void append(QQmlListProperty<QQmlFilterBase> *filterComp, QQmlFilterBase *filter);
43 static qsizetype count(QQmlListProperty<QQmlFilterBase> *filterComp);
44 static QQmlFilterBase* at(QQmlListProperty<QQmlFilterBase> *filterComp, qsizetype index);
45 static void clear(QQmlListProperty<QQmlFilterBase> *filterComp);
46
47private:
48 void append(QQmlFilterBase *);
49 qsizetype count();
50 QQmlFilterBase* at(qsizetype);
51 void clear();
52
53protected:
54 QQmlFilterCompositor(QQmlFilterBasePrivate *priv, QObject *parent);
55 virtual void refreshCache();
56
57private:
58 Q_DECLARE_PRIVATE(QQmlFilterCompositor)
59};
60
62{
63 Q_DECLARE_PUBLIC(QQmlFilterCompositor)
64
65public:
66 void init();
67 // Holds filters in the same order as declared in the qml
69 // Holds effective filters that will be evaluated with the
70 // model content
72 QQmlSortFilterProxyModel *m_sfpmModel = nullptr;
73};
74
75QT_END_NAMESPACE
76
77#endif // QQMLFILTERCOMPOSITOR_P_H
QQmlSortFilterProxyModel * m_sfpmModel
QList< QQmlFilterBase * > m_effectiveFilters
QList< QQmlFilterBase * > m_filters