From 99ac4052b30ef6d0e5afef5fef06b8eea6f80145 Mon Sep 17 00:00:00 2001 From: Ladislav Michl Date: Sun, 6 Apr 2025 21:56:12 +0200 Subject: [PATCH] Gui: do not create intermediate Quantity class in property editor --- src/Gui/propertyeditor/PropertyItem.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 7ebe9db4bd..1a180c6197 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -1786,15 +1786,11 @@ void PropertyVectorDistanceItem::setValue(const QVariant& variant) } const Base::Vector3d& value = variant.value(); - Base::Quantity x = Base::Quantity(value.x, Base::Unit::Length); - Base::Quantity y = Base::Quantity(value.y, Base::Unit::Length); - Base::Quantity z = Base::Quantity(value.z, Base::Unit::Length); - Base::QuantityFormat format(Base::QuantityFormat::Default, highPrec); std::string val = fmt::format("({}, {}, {})", - Base::UnitsApi::toNumber(x, format), - Base::UnitsApi::toNumber(y, format), - Base::UnitsApi::toNumber(z, format)); + Base::UnitsApi::toNumber(value.x, format), + Base::UnitsApi::toNumber(value.y, format), + Base::UnitsApi::toNumber(value.z, format)); setPropertyValue(val); }