summary refs log tree commit diff
path: root/src/ui/UserProfileModel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/UserProfileModel.h')
-rw-r--r--src/ui/UserProfileModel.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ui/UserProfileModel.h b/src/ui/UserProfileModel.h
new file mode 100644

index 00000000..c21a806d --- /dev/null +++ b/src/ui/UserProfileModel.h
@@ -0,0 +1,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; +}; \ No newline at end of file