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
4#ifndef QQMLFILTERCOMPOSITOR_P_H
5#define QQMLFILTERCOMPOSITOR_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/qqmlfilterbase_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQmlSortFilterProxyModel;
24
26{
27 Q_OBJECT
28 QML_ANONYMOUS
30
31public:
32 explicit QQmlFilterCompositor(QObject *parent = nullptr);
34
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
53public slots:
54 void updateCache();
55
56private:
58};
59
61{
62 Q_DECLARE_PUBLIC(QQmlFilterCompositor)
63
64public:
65 void init();
66 // Holds filters in the same order as declared in the qml
68 // Holds effective filters that will be evaluated with the
69 // model content
71 QQmlSortFilterProxyModel *m_sfpmModel = nullptr;
72};
73
74QT_END_NAMESPACE
75
76#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)