2018-05-17 18:04:42 +00:00
|
|
|
#include "MetaDataWidget.h"
|
|
|
|
#include "ui_MetaDataWidget.h"
|
|
|
|
|
2018-05-18 17:51:48 +00:00
|
|
|
#include "MetaDataModel.h"
|
|
|
|
|
|
|
|
#include <QDataWidgetMapper>
|
|
|
|
|
2018-05-17 18:04:42 +00:00
|
|
|
MetaDataWidget::MetaDataWidget(QWidget *parent)
|
2018-05-18 17:51:48 +00:00
|
|
|
: QWidget(parent)
|
|
|
|
, ui(new Ui::MetaDataWidget)
|
|
|
|
, m_widgetMapper(new QDataWidgetMapper(this))
|
2018-05-17 18:04:42 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
MetaDataWidget::~MetaDataWidget()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2018-05-18 17:51:48 +00:00
|
|
|
void MetaDataWidget::setModel(MetaDataModel *model)
|
|
|
|
{
|
|
|
|
m_widgetMapper->setModel(model);
|
|
|
|
m_widgetMapper->addMapping(ui->participantLineEdit, 0);
|
|
|
|
m_widgetMapper->addMapping(ui->instructorLineEdit, 1);
|
|
|
|
m_widgetMapper->addMapping(ui->dateOfBirthDateEdit, 2);
|
|
|
|
m_widgetMapper->addMapping(ui->dateOfTestDateEdit, 3);
|
|
|
|
m_widgetMapper->addMapping(ui->remarksPlainTextEdit, 4);
|
|
|
|
m_widgetMapper->toFirst();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaDataWidget::toFirst()
|
|
|
|
{
|
|
|
|
m_widgetMapper->toFirst();
|
|
|
|
}
|