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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -108,6 +108,7 @@ public:
|
||||
|
||||
/// Gets the expression as a string
|
||||
QString expressionText() const;
|
||||
void evaluateExpression();
|
||||
|
||||
/// Set the number portion selected
|
||||
void selectNumber();
|
||||
|
||||
Reference in New Issue
Block a user