2018-06-06 16:05:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-09 11:13:00 +00:00
|
|
|
#include "../Age.h"
|
2018-06-14 17:19:53 +00:00
|
|
|
#include "PRMap.h"
|
2018-06-06 16:05:30 +00:00
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
2018-06-14 17:19:53 +00:00
|
|
|
class PluralPR : public PRMap
|
2018-06-13 19:14:36 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-06-14 17:19:53 +00:00
|
|
|
PluralPR()
|
2018-06-13 19:14:36 +00:00
|
|
|
{
|
2018-06-14 17:19:53 +00:00
|
|
|
// clang-format off
|
|
|
|
m_ages = {
|
|
|
|
{ 4, 0 },
|
|
|
|
{ 4, 6 },
|
|
|
|
{ 5, 6 },
|
|
|
|
{ 9, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
m_PRs = {
|
|
|
|
{ 0, 0, 0 },
|
|
|
|
{ 0, 1, 0 },
|
|
|
|
{ 0, 1, 0 },
|
|
|
|
{ 1, 1, 0 },
|
|
|
|
{ 7, 2, 1 },
|
|
|
|
{ 10, 4, 1},
|
|
|
|
{ 26, 10, 2 },
|
|
|
|
{ 57, 25, 7 },
|
|
|
|
{ 79, 56, 27 },
|
|
|
|
{ 100, 100, 100 }
|
|
|
|
};
|
|
|
|
// clang-format on
|
2018-06-13 19:14:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-06-06 16:05:30 +00:00
|
|
|
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-08 18:25:21 +00:00
|
|
|
void setPluralResult(size_t points);
|
2018-06-06 16:05:30 +00:00
|
|
|
};
|