summary refs log tree commit diff
path: root/src/ui/UserProfileModel.h
blob: c21a806dd16a2f39c2bf8fec99bbc1c437c8444e (plain) (blame)
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
27
28
29
#pragma once

#include <QAbstractListModel>

class UserProfile; // forward declaration of the class UserProfile

class UserProfileModel : public QAbstractListModel
{
        Q_OBJECT
        Q_PROPERTY(UserProfile *deviceList READ getList WRITE setList)

public:
        explicit UserProfileModel(QObject *parent = nullptr);

        enum
        {
                DEVICEID,
                DISPLAYNAME
        };
        UserProfile *getList() const;
        void setList(UserProfile *devices);

        int rowCount(const QModelIndex &parent = QModelIndex()) const override;
        QVariant data(const QModelIndex &index, int role) const override;
        virtual QHash<int, QByteArray> roleNames() const override;

private:
        UserProfile *deviceList;
};