Base: Quantity: return std::string

This commit is contained in:
Ladislav Michl
2024-07-13 13:07:27 +02:00
committed by Yorik van Havre
parent 9f7218ac75
commit 0b3adee2ab
58 changed files with 573 additions and 592 deletions

View File

@@ -478,23 +478,23 @@ void ViewProviderMeasureDistance::redrawAnnotation()
auto propDistance =
dynamic_cast<App::PropertyDistance*>(pcObject->getPropertyByName("Distance"));
setLabelValue(propDistance->getQuantityValue().getUserString());
setLabelValue(QString::fromStdString(propDistance->getQuantityValue().getUserString()));
// Set delta distance
auto propDistanceX =
static_cast<App::PropertyDistance*>(getMeasureObject()->getPropertyByName("DistanceX"));
static_cast<DimensionLinear*>(pDeltaDimensionSwitch->getChild(0))
->text.setValue("Δx: " + propDistanceX->getQuantityValue().getUserString().toUtf8());
->text.setValue(("Δx: " + propDistanceX->getQuantityValue().getUserString()).c_str());
auto propDistanceY =
static_cast<App::PropertyDistance*>(getMeasureObject()->getPropertyByName("DistanceY"));
static_cast<DimensionLinear*>(pDeltaDimensionSwitch->getChild(1))
->text.setValue("Δy: " + propDistanceY->getQuantityValue().getUserString().toUtf8());
->text.setValue(("Δy: " + propDistanceY->getQuantityValue().getUserString()).c_str());
auto propDistanceZ =
static_cast<App::PropertyDistance*>(getMeasureObject()->getPropertyByName("DistanceZ"));
static_cast<DimensionLinear*>(pDeltaDimensionSwitch->getChild(2))
->text.setValue("Δz: " + propDistanceZ->getQuantityValue().getUserString().toUtf8());
->text.setValue(("Δz: " + propDistanceZ->getQuantityValue().getUserString()).c_str());
// Set matrix
SbMatrix matrix = getMatrix();
@@ -529,7 +529,6 @@ void ViewProviderMeasureDistance::onChanged(const App::Property* prop)
->backgroundColor.setValue(bColor.r, bColor.g, bColor.g);
}
ViewProviderMeasureBase::onChanged(prop);
}