connected date-edits to updates

This commit is contained in:
mandlm 2018-07-17 20:33:38 +02:00
parent 00a4d37ec3
commit b69a748f94
3 changed files with 15 additions and 2 deletions

View File

@ -17,7 +17,7 @@ DataModel::DataModel(QObject *parent)
{ {
connect(&m_plural, &PluralModel::dataChanged, this, connect(&m_plural, &PluralModel::dataChanged, this,
&DataModel::pluralModelChanged); &DataModel::pluralModelChanged);
connect(&m_metaData, &PluralModel::dataChanged, this, connect(&m_metaData, &MetaDataModel::dataChanged, this,
&DataModel::metaDataChanged); &DataModel::metaDataChanged);
connect(&m_genus, &GenusModel::dataChanged, this, connect(&m_genus, &GenusModel::dataChanged, this,
&DataModel::genusModelChanged); &DataModel::genusModelChanged);

View File

@ -4,6 +4,7 @@
#include "MetaDataModel.h" #include "MetaDataModel.h"
#include <QDataWidgetMapper> #include <QDataWidgetMapper>
#include <QDebug>
MetaDataWidget::MetaDataWidget(QWidget *parent) MetaDataWidget::MetaDataWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
@ -11,6 +12,11 @@ MetaDataWidget::MetaDataWidget(QWidget *parent)
, m_widgetMapper(new QDataWidgetMapper(this)) , m_widgetMapper(new QDataWidgetMapper(this))
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->dateOfTestDateEdit, &QDateEdit::dateChanged, m_widgetMapper,
&QDataWidgetMapper::submit);
connect(ui->dateOfBirthDateEdit, &QDateEdit::dateChanged, m_widgetMapper,
&QDataWidgetMapper::submit);
} }
MetaDataWidget::~MetaDataWidget() MetaDataWidget::~MetaDataWidget()

View File

@ -61,7 +61,14 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDateEdit" name="dateOfTestDateEdit"/> <widget class="QDateEdit" name="dateOfTestDateEdit">
<property name="displayFormat">
<string>M/d/yyyy</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">