File indexing completed on 2024-12-01 07:40:33

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 <QQmlEngine>
0007 #include <QSortFilterProxyModel>
0008 
0009 class DevicesProxyModel : public QSortFilterProxyModel
0010 {
0011     Q_OBJECT
0012     QML_ELEMENT
0013 
0014     Q_PROPERTY(int type READ type WRITE setType NOTIFY typeChanged)
0015 
0016 public:
0017     DevicesProxyModel(QObject *parent = nullptr);
0018     [[nodiscard]] bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0019 
0020     void setType(int type);
0021     [[nodiscard]] int type() const;
0022 
0023 Q_SIGNALS:
0024     void typeChanged();
0025 
0026 private:
0027     int m_type;
0028 };