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
Raw Normal View History

2018-06-06 16:05:30 +00:00
#pragma once
2018-12-15 15:12:20 +00:00
#include "../PrintableModel.h"
#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-12-15 15:12:20 +00:00
class ResultModel : public QAbstractTableModel, protected PrintableModel
2018-06-06 16:05:30 +00:00
{
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-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);
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);
2018-12-15 15:12:20 +00:00
void printTo(QTextCursor &cursor) const override;
2018-06-06 16:05:30 +00:00
};