summaryrefslogtreecommitdiffstats
path: root/framework/settings/resourcelistmodel.h
blob: de1b5a517192339304d0629d69fce45fb8f8baef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <QIdentityProxyModel>
#include <QSharedPointer>
#include <QStringList>

class ResourceListModel : public QIdentityProxyModel
{
    Q_OBJECT

public:
    ResourceListModel(QObject *parent = Q_NULLPTR);
    ~ResourceListModel();

    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;

    enum Roles {
        Id  = Qt::UserRole + 1,
        Type
    };

    QHash<int, QByteArray> roleNames() const;

private:
    QSharedPointer<QAbstractItemModel> m_model;
};