Changeset View
Changeset View
Standalone View
Standalone View
cuttlefish/src/iconmodel.h
Show All 21 Lines | |||||
22 | #ifndef CUTTLEFISHICONMODEL_H | 22 | #ifndef CUTTLEFISHICONMODEL_H | ||
23 | #define CUTTLEFISHICONMODEL_H | 23 | #define CUTTLEFISHICONMODEL_H | ||
24 | 24 | | |||
25 | #include <QAbstractListModel> | 25 | #include <QAbstractListModel> | ||
26 | #include <QJsonArray> | 26 | #include <QJsonArray> | ||
27 | #include <QJsonObject> | 27 | #include <QJsonObject> | ||
28 | #include <QFileInfo> | 28 | #include <QFileInfo> | ||
29 | #include <QVariantMap> | 29 | #include <QVariantMap> | ||
30 | #include <QVariantList> | ||||
30 | 31 | | |||
31 | namespace CuttleFish { | 32 | namespace CuttleFish { | ||
32 | 33 | | |||
33 | 34 | | |||
34 | class IconModel : public QAbstractListModel | 35 | class IconModel : public QAbstractListModel | ||
35 | { | 36 | { | ||
36 | Q_OBJECT | 37 | Q_OBJECT | ||
37 | 38 | | |||
Show All 16 Lines | 49 | enum Roles { | |||
54 | Scalable, | 55 | Scalable, | ||
55 | Sizes, | 56 | Sizes, | ||
56 | Type, | 57 | Type, | ||
57 | Theme | 58 | Theme | ||
58 | }; | 59 | }; | ||
59 | 60 | | |||
60 | explicit IconModel(QObject *parent = nullptr); | 61 | explicit IconModel(QObject *parent = nullptr); | ||
61 | 62 | | |||
63 | Q_INVOKABLE QVariantList inOtherThemes(const QString& iconName, int size); | ||||
62 | 64 | | |||
63 | QHash<int, QByteArray> roleNames() const override; | 65 | QHash<int, QByteArray> roleNames() const override; | ||
64 | int rowCount(const QModelIndex &parent) const override; | 66 | int rowCount(const QModelIndex &parent) const override; | ||
65 | QVariant data(const QModelIndex &index, int role) const override; | 67 | QVariant data(const QModelIndex &index, int role) const override; | ||
66 | 68 | | |||
67 | QString key(int role) const; | 69 | QString key(int role) const; | ||
68 | 70 | | |||
69 | bool matchIcons(const QFileInfo &info); | 71 | bool matchIcons(const QFileInfo &info); | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |