diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 834ebdc554..36a9e03da4 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -629,6 +629,11 @@ void QuantitySpinBox::finishFormulaDialog() } void QuantitySpinBox::handlePendingEmit() +{ + updateFromCache(true); +} + +void QuantitySpinBox::updateFromCache(bool notify) { Q_D(QuantitySpinBox); if (d->pendingEmit) { @@ -639,9 +644,11 @@ void QuantitySpinBox::handlePendingEmit() d->quantity = res; // signaling - d->pendingEmit = false; - valueChanged(res); - valueChanged(res.getValue()); + if (notify) { + d->pendingEmit = false; + valueChanged(res); + valueChanged(res.getValue()); + } } } @@ -791,8 +798,7 @@ QAbstractSpinBox::StepEnabled QuantitySpinBox::stepEnabled() const void QuantitySpinBox::stepBy(int steps) { Q_D(QuantitySpinBox); - - handlePendingEmit(); + updateFromCache(false); double step = d->singleStep * steps; double val = d->unitValue + step; @@ -802,6 +808,7 @@ void QuantitySpinBox::stepBy(int steps) val = d->minimum; lineEdit()->setText(QString::fromUtf8("%L1 %2").arg(val).arg(d->unitStr)); + updateFromCache(true); update(); selectNumber(); } diff --git a/src/Gui/QuantitySpinBox.h b/src/Gui/QuantitySpinBox.h index 7e8f77e7e6..e1cfd41e05 100644 --- a/src/Gui/QuantitySpinBox.h +++ b/src/Gui/QuantitySpinBox.h @@ -159,6 +159,7 @@ protected: private: void updateText(const Base::Quantity&); + void updateFromCache(bool); QString getUserString(const Base::Quantity& val, double& factor, QString& unitString) const; QString getUserString(const Base::Quantity& val) const;