Skip to content

Commit

Permalink
Gui: [skip ci] avoid to override the format settings of the quantity …
Browse files Browse the repository at this point in the history
…after validating the input text
  • Loading branch information
wwmayer committed Apr 28, 2020
1 parent 860188c commit 227246e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Gui/QuantitySpinBox.cpp
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 227246e

Please sign in to comment.