Base: QuantityFormat: avoid storing formatting defaults

User defined precision and fractional inch are stored on QuantityFormat
construction making changes persistent to object life time.
Change that so until not explicitely overriden, user defined values
are always returned.

Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
This commit is contained in:
Ladislav Michl
2025-09-02 23:17:22 +02:00
parent 0278a1298d
commit a5f039dd6a
10 changed files with 42 additions and 29 deletions

View File

@@ -563,13 +563,13 @@ QString InputField::getUnitText()
int InputField::getPrecision() const
{
return this->actQuantity.getFormat().precision;
return this->actQuantity.getFormat().getPrecision();
}
void InputField::setPrecision(const int precision)
{
Base::QuantityFormat format = actQuantity.getFormat();
format.precision = precision;
format.setPrecision(precision);
actQuantity.setFormat(format);
updateText(actQuantity);
}