Index: sources/view/hd/data/VHDPostSingleResultData.h =================================================================== diff -u -r4e708c6e93443b01ac26c71a466708916ede4abf -r83ffaef436920eba534cde428e14d168ea931bea --- sources/view/hd/data/VHDPostSingleResultData.h (.../VHDPostSingleResultData.h) (revision 4e708c6e93443b01ac26c71a466708916ede4abf) +++ sources/view/hd/data/VHDPostSingleResultData.h (.../VHDPostSingleResultData.h) (revision 83ffaef436920eba534cde428e14d168ea931bea) @@ -16,11 +16,13 @@ // Qt #include +#include // Project #include "main.h" // Doxygen : don't remove #include "VView.h" #include "MHDPostSingleResultData.h" +#include "MSettings.h" // namespace namespace View { @@ -32,12 +34,38 @@ * \sa Model::MHDPostSingleResultData * */ -class VHDPostSingleResult : public QObject { +class VHDPostSingleResult : public QAbstractListModel { Q_OBJECT - PROPERTY( quint32, result, 0) - PROPERTY( quint32, index, 0) + PROPERTY(quint32, result, 0) + PROPERTY(quint32, index, 0) - VIEW_DEC(VHDPostSingleResult, HDPostSingleResultData) + VIEW_DEC_SLOT(HDPostSingleResultData) + VIEW_DEC_SLOT(SettingsData) + +private: + struct PostTest { + QString name; + quint32 result = 2; + }; + + QList _tests; + +public: + explicit VHDPostSingleResult(QAbstractListModel *parent = nullptr); + + enum TestDataRole { + TestNameRole = Qt::UserRole + 1, + TestResultRole, + }; +protected: + int rowCount (const QModelIndex &parent = QModelIndex()) const override; + QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override; + QHash roleNames() const override; + bool setData(int vIndex, const QVariant &vValue, const TestDataRole &vRole); + void removeAllRows(); +private: + void initConnections(); + void addSelfTest(const PostTest &vTest); }; }