2018-05-15 12:24:15 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-01-12 15:50:04 +00:00
|
|
|
#include "../PrintableModel.h"
|
|
|
|
|
2018-11-24 18:55:16 +00:00
|
|
|
#include "Age.h"
|
2018-06-08 18:25:21 +00:00
|
|
|
|
2018-11-16 22:21:02 +00:00
|
|
|
#include "MetaDataModel.pb.h"
|
|
|
|
|
2018-05-15 12:24:15 +00:00
|
|
|
#include <QAbstractTableModel>
|
|
|
|
#include <QString>
|
|
|
|
#include <QDate>
|
|
|
|
|
2019-01-12 15:50:04 +00:00
|
|
|
class MetaDataModel : public QAbstractTableModel, public PrintableModel
|
2018-05-15 12:24:15 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_participant;
|
|
|
|
QString m_instructor;
|
|
|
|
QDate m_dateOfBirth;
|
|
|
|
QDate m_dateOfTest;
|
|
|
|
QString m_remarks;
|
|
|
|
|
|
|
|
public:
|
|
|
|
MetaDataModel(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;
|
2018-05-17 17:42:35 +00:00
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
bool setData(const QModelIndex &index, const QVariant &value,
|
|
|
|
int role = Qt::EditRole) override;
|
2018-05-15 12:37:16 +00:00
|
|
|
|
2018-11-20 06:59:12 +00:00
|
|
|
void read(const ESGRAF48::MetaDataModel &model);
|
|
|
|
void write(ESGRAF48::MetaDataModel &model) const;
|
2018-11-16 22:21:02 +00:00
|
|
|
|
2019-01-12 15:50:04 +00:00
|
|
|
void printTo(QPainter &painter) const override;
|
2018-11-03 21:29:38 +00:00
|
|
|
|
2018-06-08 18:25:21 +00:00
|
|
|
Age getAge() const
|
|
|
|
{
|
2018-06-09 11:13:00 +00:00
|
|
|
return { m_dateOfBirth, m_dateOfTest };
|
2018-06-08 18:25:21 +00:00
|
|
|
}
|
2018-05-15 12:24:15 +00:00
|
|
|
};
|