KWin
Loading...
Searching...
No Matches
effectsfilterproxymodel.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QSortFilterProxyModel>
10
11namespace KWin
12{
13
14class EffectsFilterProxyModel : public QSortFilterProxyModel
15{
16 Q_OBJECT
17 Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setSourceModel)
18 Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged)
21
22public:
23 explicit EffectsFilterProxyModel(QObject *parent = nullptr);
24 ~EffectsFilterProxyModel() override;
25
26 QString query() const;
27 void setQuery(const QString &query);
28
29 bool excludeInternal() const;
30 void setExcludeInternal(bool exclude);
31
32 bool excludeUnsupported() const;
33 void setExcludeUnsupported(bool exclude);
34
35Q_SIGNALS:
39
40protected:
41 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
42
44 QString m_query;
45 bool m_excludeInternal = true;
46 bool m_excludeUnsupported = true;
47
48 Q_DISABLE_COPY(EffectsFilterProxyModel)
49};
50
51} // namespace KWin
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
void setQuery(const QString &query)
#define private
#define explicit