Gui: if an expression is set for Euler angles in the placement dialog then evaluate the expression instead of determining the angles from the rotation

See forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=72522
This commit is contained in:
wmayer
2022-10-26 11:27:46 +02:00
parent bcc9c6654c
commit 4d8e61549d
3 changed files with 12 additions and 0 deletions

View File

@@ -658,6 +658,10 @@ void Placement::bindObject()
ui->yawAngle ->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Rotation.Yaw")));
ui->pitchAngle->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Rotation.Pitch")));
ui->rollAngle ->bind(App::ObjectIdentifier::parse(obj, propertyName + std::string(".Rotation.Roll")));
ui->yawAngle->evaluateExpression();
ui->pitchAngle->evaluateExpression();
ui->rollAngle->evaluateExpression();
}
}

View File

@@ -417,6 +417,13 @@ QString Gui::QuantitySpinBox::expressionText() const
return QString();
}
void QuantitySpinBox::evaluateExpression()
{
if (isBound() && getExpression()) {
showValidExpression(Number::SetIfNumber);
}
}
void Gui::QuantitySpinBox::setNumberExpression(App::NumberExpression* expr)
{
lineEdit()->setText(getUserString(expr->getQuantity()));

View File

@@ -108,6 +108,7 @@ public:
/// Gets the expression as a string
QString expressionText() const;
void evaluateExpression();
/// Set the number portion selected
void selectNumber();