summary refs log tree commit diff
path: root/src/ui/UserProfileModel.h
diff options
context:
space:
mode:
authorCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-05-27 14:19:26 +0530
committerCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-07-30 22:10:27 +0530
commitf9c0f4dd5410621a8427e2ef21496b7791d44d2f (patch)
tree5c1ea107d3d4fff722538549f59454d87c1a667b /src/ui/UserProfileModel.h
parentAdding DeviceList for userprofile (diff)
downloadnheko-f9c0f4dd5410621a8427e2ef21496b7791d44d2f.tar.xz
Add C++ Model for DeviceList
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