Commit d17fdc04 authored by Laurent Montel's avatar Laurent Montel 😁

Start to create full value support aka "*"

parent 8b6391aa
...@@ -77,6 +77,7 @@ void SelectDateWidget::initialize() ...@@ -77,6 +77,7 @@ void SelectDateWidget::initialize()
connect(mDateLineEdit, &QLineEdit::textChanged, this, &SelectDateWidget::valueChanged); connect(mDateLineEdit, &QLineEdit::textChanged, this, &SelectDateWidget::valueChanged);
mDateValue = new QSpinBox; mDateValue = new QSpinBox;
mDateValue->setSpecialValueText(QStringLiteral("*"));
mStackWidget->addWidget(mDateValue); mStackWidget->addWidget(mDateValue);
connect(mDateValue, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SelectDateWidget::valueChanged); connect(mDateValue, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SelectDateWidget::valueChanged);
...@@ -99,36 +100,36 @@ void SelectDateWidget::slotDateTypeActivated(int index) ...@@ -99,36 +100,36 @@ void SelectDateWidget::slotDateTypeActivated(int index)
switch (type) { switch (type) {
case Year: case Year:
mStackWidget->setCurrentWidget(mDateValue); mStackWidget->setCurrentWidget(mDateValue);
mDateValue->setMinimum(0); mDateValue->setMinimum(-1);
mDateValue->setMaximum(9999); mDateValue->setMaximum(9999);
break; break;
case Month: case Month:
mStackWidget->setCurrentWidget(mDateValue); mStackWidget->setCurrentWidget(mDateValue);
mDateValue->setMinimum(1); mDateValue->setMinimum(0);
mDateValue->setMaximum(12); mDateValue->setMaximum(12);
break; break;
case Day: case Day:
mStackWidget->setCurrentWidget(mDateValue); mStackWidget->setCurrentWidget(mDateValue);
mDateValue->setMinimum(1); mDateValue->setMinimum(0);
mDateValue->setMaximum(31); mDateValue->setMaximum(31);
break; break;
case Hour: case Hour:
mStackWidget->setCurrentWidget(mDateValue); mStackWidget->setCurrentWidget(mDateValue);
mDateValue->setMinimum(0); mDateValue->setMinimum(-1);
mDateValue->setMaximum(23); mDateValue->setMaximum(23);
break; break;
case Minute: case Minute:
mDateValue->setMinimum(0); mDateValue->setMinimum(-1);
mDateValue->setMaximum(59); mDateValue->setMaximum(59);
mStackWidget->setCurrentWidget(mDateValue); mStackWidget->setCurrentWidget(mDateValue);
break; break;
case Second: case Second:
mDateValue->setMinimum(0); mDateValue->setMinimum(-1);
mDateValue->setMaximum(60); mDateValue->setMaximum(59);
mStackWidget->setCurrentWidget(mDateValue); mStackWidget->setCurrentWidget(mDateValue);
break; break;
case Weekday: case Weekday:
mDateValue->setMinimum(0); mDateValue->setMinimum(-1);
mDateValue->setMaximum(6); mDateValue->setMaximum(6);
mStackWidget->setCurrentWidget(mDateValue); mStackWidget->setCurrentWidget(mDateValue);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment