File indexing completed on 2024-05-05 05:28:25

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
0003  * SPDX-License-Identifier: GPL-2.0-or-later
0004  */
0005 
0006 #pragma once
0007 
0008 #include <QSortFilterProxyModel>
0009 
0010 #include "modulesmodel.h"
0011 
0012 class ModulesProxyModel : public QSortFilterProxyModel
0013 {
0014     Q_OBJECT
0015     Q_PROPERTY(QString filterString READ filterString WRITE setFilterString NOTIFY filterStringChanged)
0016 
0017 public:
0018     ModulesProxyModel(QObject *parent = nullptr);
0019 
0020     QString filterString() const;
0021     void setFilterString(QString filterString);
0022 
0023     bool filterAcceptsRow(int sourceRow, const QModelIndex &parent) const override;
0024 
0025 Q_SIGNALS:
0026     void filterStringChanged();
0027 
0028 private:
0029     QString m_filterString;
0030 
0031     ModulesModel *m_model;
0032 };