File indexing completed on 2024-11-03 10:41:27

0001 // SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 #pragma once
0005 
0006 #include <QSortFilterProxyModel>
0007 
0008 class DevicesProxyModel : public QSortFilterProxyModel
0009 {
0010     Q_OBJECT
0011     Q_PROPERTY(int type READ type WRITE setType NOTIFY typeChanged);
0012 
0013 public:
0014     DevicesProxyModel(QObject *parent = nullptr);
0015     [[nodiscard]] bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0016 
0017     void setType(int type);
0018     [[nodiscard]] int type() const;
0019 
0020 Q_SIGNALS:
0021     void typeChanged();
0022 
0023 private:
0024     int m_type;
0025 };