ESGRAF48/source/MetaData/MetaDataModel.h

32 lines
807 B
C
Raw Normal View History

#pragma once
#include <QAbstractTableModel>
#include <QString>
#include <QDate>
2018-05-15 12:37:16 +00:00
#include <QJsonObject>
class MetaDataModel : public QAbstractTableModel
{
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-05-16 05:02:12 +00:00
void write(QJsonObject &json) const;
2018-05-15 12:37:16 +00:00
void read(const QJsonObject &json);
};