File indexing completed on 2024-09-15 13:01:34
0001 /* 0002 Mobile proxy model - model for displaying netwoks in mobile kcm 0003 SPDX-FileCopyrightText: 2017 Martin Kacej <m.kacej@atlas.sk> 0004 0005 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 0007 */ 0008 0009 #ifndef PLASMA_NM_MOBILE_PROXY_MODEL_H 0010 #define PLASMA_NM_MOBILE_PROXY_MODEL_H 0011 0012 #include <QSortFilterProxyModel> 0013 0014 class Q_DECL_EXPORT MobileProxyModel : public QSortFilterProxyModel 0015 { 0016 Q_OBJECT 0017 Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setSourceModel) 0018 Q_PROPERTY(bool showSavedMode READ showSavedMode WRITE setShowSavedMode NOTIFY showSavedModeChanged) 0019 public: 0020 explicit MobileProxyModel(QObject *parent = nullptr); 0021 ~MobileProxyModel() override; 0022 void setShowSavedMode(bool mode); 0023 bool showSavedMode() const; 0024 signals: 0025 void showSavedModeChanged(bool mode); 0026 0027 protected: 0028 bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const Q_DECL_OVERRIDE; 0029 bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; 0030 0031 private: 0032 bool m_showSavedMode = false; 0033 }; 0034 0035 #endif // PLASMA_NM_MOBILE_PROXY_MODEL_H