1 // SPDX-License-Identifier: Apache-2.0
3 * Copyright (C) 2016 The Qt Company Ltd.
4 * Copyright (c) 2018,2019 TOYOTA MOTOR CORPORATION
5 * Copyright (C) 2022 Konsulko Group
8 #ifndef APPLICATIONMODEL_H
9 #define APPLICATIONMODEL_H
11 #include <QAbstractListModel>
13 class ApplicationModel : public QAbstractListModel
18 explicit ApplicationModel(QObject *parent = nullptr);
21 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
23 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
24 QHash<int, QByteArray> roleNames() const override;
25 Q_INVOKABLE QString appid(int index) const;
26 Q_INVOKABLE QString id(int index) const;
27 Q_INVOKABLE QString name(int index) const;
28 Q_INVOKABLE void move(int from, int to);
29 Q_INVOKABLE void initAppList(QList<QMap<QString, QString>> &apps);
30 Q_INVOKABLE void updateApplist(QStringList info);
37 #endif // APPLICATIONMODEL_H