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 e7cd72b2e0
commit 01b547912f
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);
}