File indexing completed on 2024-05-12 09:39:00

0001 /*
0002     SPDX-FileCopyrightText: 2013-2014 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_APPLET_PROXY_MODEL_H
0008 #define PLASMA_NM_APPLET_PROXY_MODEL_H
0009 
0010 #include "plasmanm_internal_export.h"
0011 
0012 #include <QSortFilterProxyModel>
0013 
0014 #include <qqmlregistration.h>
0015 
0016 class PLASMANM_INTERNAL_EXPORT AppletProxyModel : public QSortFilterProxyModel
0017 {
0018     Q_OBJECT
0019     QML_ELEMENT
0020     Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setSourceModel)
0021 public:
0022     explicit AppletProxyModel(QObject *parent = nullptr);
0023     ~AppletProxyModel() override;
0024 
0025 protected:
0026     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0027     bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
0028 };
0029 
0030 #endif // PLASMA_NM_APPLET_PROXY_MODEL_H