From f1d79d9ab42e049f7a255d6be9f072ae5aba6f67 Mon Sep 17 00:00:00 2001 From: xtemp09 Date: Fri, 21 Nov 2025 19:36:04 +0700 Subject: [PATCH] [GUI] Make precision of QuantitySpinBox accessible from Python --- src/Gui/QuantitySpinBox.cpp | 1 + src/Gui/QuantitySpinBox.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 3cec76ed7c..608fab4e0f 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -886,6 +886,7 @@ void QuantitySpinBox::stepBy(int steps) } Quantity quant(val, d->unitStr.toStdString()); + quant.setFormat(d->quantity.getFormat()); updateText(quant); updateFromCache(true); update(); diff --git a/src/Gui/QuantitySpinBox.h b/src/Gui/QuantitySpinBox.h index 691ebf8d1c..fe9a7c6728 100644 --- a/src/Gui/QuantitySpinBox.h +++ b/src/Gui/QuantitySpinBox.h @@ -46,6 +46,7 @@ class GuiExport QuantitySpinBox: public QAbstractSpinBox, public ExpressionSpinB double singleStep READ singleStep WRITE setSingleStep ) // clazy:exclude=qproperty-without-notify Q_PROPERTY(double rawValue READ rawValue WRITE setValue NOTIFY valueChanged) + Q_PROPERTY(double decimals READ decimals WRITE setDecimals) Q_PROPERTY(Base::Quantity value READ value WRITE setValue NOTIFY valueChanged USER true) Q_PROPERTY( QString binding READ boundToName WRITE setBoundToByName