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
27{
28 Q_OBJECT
29 QML_ANONYMOUS
31
32public:
33 explicit QQmlFilterCompositor(QObject *parent = nullptr);
35
38
39 bool filterAcceptsRowInternal(int, const QModelIndex&, const QQmlSortFilterProxyModel *) const override;
40 bool filterAcceptsColumnInternal(int, const QModelIndex&, const QQmlSortFilterProxyModel *) const override;
41 void updateFilters();
42
43 static void append(QQmlListProperty<QQmlFilterBase> *filterComp, QQmlFilterBase *filter);
44 static qsizetype count(QQmlListProperty<QQmlFilterBase> *filterComp);
45 static QQmlFilterBase* at(QQmlListProperty<QQmlFilterBase> *filterComp, qsizetype index);
46 static void clear(QQmlListProperty<QQmlFilterBase> *filterComp);
47
48private:
49 void append(QQmlFilterBase *);
50 qsizetype count();
51 QQmlFilterBase* at(qsizetype);
52 void clear();
53
54public slots:
55 void updateCache();
56
57private:
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
bool filterAcceptsColumnInternal(int, const QModelIndex &, const QQmlSortFilterProxyModel *) const override
bool filterAcceptsRowInternal(int, const QModelIndex &, const QQmlSortFilterProxyModel *) const override
static qsizetype count(QQmlListProperty< QQmlFilterBase > *filterComp)
QQmlListProperty< QQmlFilterBase > filtersListProperty()
static void append(QQmlListProperty< QQmlFilterBase > *filterComp, QQmlFilterBase *filter)
static QQmlFilterBase * at(QQmlListProperty< QQmlFilterBase > *filterComp, qsizetype index)
QList< QQmlFilterBase * > filters()
static void clear(QQmlListProperty< QQmlFilterBase > *filterComp)