#pragma once #include "ParticipantRepo.h" #include "QuestionRepo.h" #include #include #include #include class ParticipantModel : public QAbstractTableModel { Q_OBJECT private: ParticipantRepo& repo; QuestionRepo& qrepo; std::unordered_set answered; public: ParticipantModel(ParticipantRepo& repo, QuestionRepo& qrepo, QObject* parent = nullptr); int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; void answerQuestion(const int index, const std::string& answer); };