/* * SPDX-FileCopyrightText: 2015 Kai Uwe Broulik * * SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include #include #include #include class BatteryModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(int count READ rowCount NOTIFY countChanged) public: explicit BatteryModel(QObject *parent); ~BatteryModel() override = default; enum Roles { BatteryRole = Qt::UserRole, UdiRole, VendorRole, ProductRole, }; Q_ENUM(Roles) QVariant data(const QModelIndex &index, int role) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; QHash roleNames() const override; signals: void countChanged(); private: QList m_batteries; };