File indexing completed on 2024-10-06 09:45:31

0001 // SPDX-FileCopyrightText: (C) 2020 Carl Schwan <carl@carlschwan.eu>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-or-later
0004 
0005  
0006 #pragma once
0007 
0008 #include <QQuickItem>
0009 #include <QStandardItemModel>
0010 #include <KLocalizedContext>
0011 
0012 class GamesModel : public QStandardItemModel
0013 {
0014     Q_OBJECT
0015 public:
0016     enum AdditionalRoles {
0017         PluginIdRole = Qt::UserRole + 1,
0018     };
0019     Q_ENUM(AdditionalRoles)
0020 
0021     GamesModel(QObject *parent = nullptr);
0022     ~GamesModel() = default;
0023 
0024     Q_INVOKABLE void reload();
0025     Q_INVOKABLE QString pluginId(int row);
0026     
0027     QHash<int, QByteArray> roleNames() const override;
0028 };