This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ESGRAF48/source/ResultWidget/ResultModel.h

42 lines
1.1 KiB
C++

#pragma once
#include "../PrintableModel.h"
#include "Age.h"
#include "TestResult.h"
#include <QAbstractTableModel>
#include <QTextCursor>
class ResultModel : public QAbstractTableModel, protected PrintableModel
{
Q_OBJECT
private:
Age m_age;
std::vector<TestResult> m_results;
public:
ResultModel(QObject *parent);
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 setAge(const Age &age);
void setPluralResult(unsigned int points);
void setGenusResult(unsigned int points);
void setVerbEndResult(unsigned int points);
void setAkkusativResult(unsigned int points);
void setDativResult(unsigned int points);
void setV2Result(unsigned int points);
void setSvkResult(unsigned int points);
void setPassivResult(unsigned int points);
void setGenitivResult(unsigned int points);
void printTo(QTextCursor &cursor) const override;
};