2018-06-06 16:05:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-09 11:13:00 +00:00
|
|
|
#include "../Age.h"
|
2018-06-06 16:05:30 +00:00
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
|
|
|
class TestResult
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
QString m_name;
|
2018-06-14 17:19:53 +00:00
|
|
|
size_t m_points = 0;
|
|
|
|
size_t m_pr = 0;
|
2018-06-06 16:05:30 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
TestResult(const char *name)
|
|
|
|
: m_name(name)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-06-14 17:19:53 +00:00
|
|
|
void setPoints(const size_t &points)
|
2018-06-08 18:25:21 +00:00
|
|
|
{
|
|
|
|
m_points = points;
|
|
|
|
}
|
|
|
|
|
2018-06-14 17:19:53 +00:00
|
|
|
void setPR(const unsigned int &pr)
|
|
|
|
{
|
|
|
|
m_pr = pr;
|
|
|
|
}
|
|
|
|
|
2018-06-06 16:05:30 +00:00
|
|
|
const QString &name() const
|
|
|
|
{
|
|
|
|
return m_name;
|
|
|
|
}
|
2018-06-08 18:25:21 +00:00
|
|
|
|
|
|
|
const size_t points() const
|
|
|
|
{
|
|
|
|
return m_points;
|
|
|
|
}
|
2018-06-14 17:19:53 +00:00
|
|
|
|
|
|
|
const size_t pr() const
|
|
|
|
{
|
|
|
|
return m_pr;
|
|
|
|
}
|
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;
|
|
|
|
|
|
|
|
QVariant data(
|
|
|
|
const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation,
|
|
|
|
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-06 16:05:30 +00:00
|
|
|
};
|