File indexing completed on 2024-05-12 05:35:45
0001 /* 0002 SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de> 0003 0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #pragma once 0008 0009 #include <QSortFilterProxyModel> 0010 0011 class FilteredShortcutsModel : public QSortFilterProxyModel 0012 { 0013 Q_OBJECT 0014 0015 Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) 0016 0017 public: 0018 explicit FilteredShortcutsModel(QObject *parent); 0019 0020 bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; 0021 0022 QString filter() const; 0023 void setFilter(const QString &filter); 0024 0025 Q_SIGNALS: 0026 void filterChanged(); 0027 0028 private: 0029 QString m_filter; 0030 };