Warning, file /utilities/telly-skout/src/groupsmodel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // SPDX-FileCopyrightText: 2022 Plata Hill <plata.hill@kdemail.net> 0002 // SPDX-License-Identifier: LGPL-2.1-or-later 0003 0004 #pragma once 0005 0006 #include <QAbstractListModel> 0007 0008 #include "groupfactory.h" 0009 0010 class Group; 0011 0012 class GroupsModel : public QAbstractListModel 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 explicit GroupsModel(QObject *parent = nullptr); 0018 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 0019 QHash<int, QByteArray> roleNames() const override; 0020 int rowCount(const QModelIndex &parent) const override; 0021 0022 private: 0023 void loadGroup(int index) const; 0024 0025 mutable QVector<Group *> m_groups; 0026 GroupFactory m_groupFactory; 0027 };