2018-06-06 16:05:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-11-24 18:55:16 +00:00
|
|
|
#include "Age.h"
|
2018-12-02 17:26:22 +00:00
|
|
|
#include "TestResult.h"
|
2018-06-06 16:05:30 +00:00
|
|
|
|
2018-12-02 17:26:22 +00:00
|
|
|
#include <QAbstractTableModel>
|
|
|
|
#include <QTextCursor>
|
2018-06-14 17:19:53 +00:00
|
|
|
|
2018-06-06 16:05:30 +00:00
|
|
|
|
|
|
|
class ResultModel : public QAbstractTableModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
2018-06-09 11:13:00 +00:00
|
|
|
Age m_age;
|
2018-06-06 16:05:30 +00:00
|
|
|
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;
|
|
|
|
|
2018-12-02 17:26:22 +00:00
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
2018-06-06 16:05:30 +00:00
|
|
|
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation,
|
2018-12-02 17:26:22 +00:00
|
|
|
int role = Qt::DisplayRole) const override;
|
2018-06-08 18:25:21 +00:00
|
|
|
|
2018-06-09 11:13:00 +00:00
|
|
|
void setAge(const Age &age);
|
2018-06-15 15:53:43 +00:00
|
|
|
void setPluralResult(unsigned int points);
|
|
|
|
void setGenusResult(unsigned int points);
|
2018-06-15 16:36:58 +00:00
|
|
|
void setVerbEndResult(unsigned int points);
|
2018-06-17 16:44:54 +00:00
|
|
|
void setAkkusativResult(unsigned int points);
|
|
|
|
void setDativResult(unsigned int points);
|
2018-06-25 21:04:32 +00:00
|
|
|
void setV2Result(unsigned int points);
|
|
|
|
void setSvkResult(unsigned int points);
|
2018-12-02 17:26:22 +00:00
|
|
|
void setPassivResult(unsigned int points);
|
|
|
|
void setGenitivResult(unsigned int points);
|
|
|
|
|
|
|
|
void printTo(QTextCursor &cursor) const;
|
2018-06-06 16:05:30 +00:00
|
|
|
};
|