#pragma once // Qt #include #include #include #include // Project #include "main.h" // Doxygen : do not remove #include "VView.h" // namespace namespace View { class VAlarmInstructionsModel : public QAbstractListModel { Q_OBJECT QHash _dataRoles { { eRole_Instruction , "instruction" }, { eRole_Image , "image" }, }; public: typedef enum { eRole_Instruction = Qt::UserRole, eRole_Image , } DataRole; QHash roleNames ( ) const override; int rowCount (const QModelIndex & = QModelIndex() ) const override; QVariant data (const QModelIndex &vIndex, int vRole = Qt::DisplayRole ) const override; bool setData (const QModelIndex &vIndex, const QVariant& vValue, int vRole = Qt::EditRole) override; void clear ( ); void appendData (const QHash &vData ); Q_INVOKABLE QVariantMap get (int vRow ) const; // Exposed to QML VIEW_DEC_CLASS_EX(VAlarmInstructionsModel, QAbstractListModel) private: QList> _data; }; }