File indexing completed on 2024-11-10 10:59:57

0001 /*
0002     SPDX-FileCopyrightText: 2013-2018 Jan Grulich <jgrulich@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef PLASMA_NM_EDITOR_PROXY_MODEL_H
0008 #define PLASMA_NM_EDITOR_PROXY_MODEL_H
0009 
0010 #include <QSortFilterProxyModel>
0011 
0012 class Q_DECL_EXPORT EditorProxyModel : public QSortFilterProxyModel
0013 {
0014     Q_OBJECT
0015     Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setSourceModel)
0016 public:
0017     explicit EditorProxyModel(QObject *parent = nullptr);
0018     ~EditorProxyModel() override;
0019 
0020 protected:
0021     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0022     bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
0023 };
0024 
0025 #endif // PLASMA_NM_EDITOR_PROXY_MODEL_H