Base: make UnitsApi::toString method of Quantity

This static method takes Quantity as a parameter, so make it
method of Quantity directly.
This commit is contained in:
Ladislav Michl
2025-04-06 22:16:21 +02:00
parent 9cfd5c7f48
commit e3852f7732
5 changed files with 9 additions and 13 deletions

View File

@@ -1187,7 +1187,7 @@ void PropertyUnitItem::setValue(const QVariant& value)
if (!hasExpression() && value.canConvert<Base::Quantity>()) {
const Base::Quantity& val = value.value<Base::Quantity>();
Base::QuantityFormat format(Base::QuantityFormat::Default, highPrec);
setPropertyValue(Base::UnitsApi::toString(val, format));
setPropertyValue(val.toString(format));
}
}