Gui: [skip ci] avoid to override the format settings of the quantity after validating the input text

This commit is contained in:
wmayer
2020-04-28 18:43:50 +02:00
parent b678080541
commit 0d4a29aa0c

View File

@@ -540,6 +540,7 @@ void QuantitySpinBox::userInput(const QString & text)
int pos = 0;
QValidator::State state;
Base::Quantity res = d->validateAndInterpret(tmp, pos, state);
res.setFormat(d->quantity.getFormat());
if (state == QValidator::Acceptable) {
d->validInput = true;
d->validStr = text;
@@ -549,6 +550,7 @@ void QuantitySpinBox::userInput(const QString & text)
tmp += QLatin1Char(' ');
tmp += d->unitStr;
Base::Quantity res2 = d->validateAndInterpret(tmp, pos, state);
res2.setFormat(d->quantity.getFormat());
if (state == QValidator::Acceptable) {
d->validInput = true;
d->validStr = tmp;