diff --git a/src/Gui/Inventor/Draggers/Gizmo.cpp b/src/Gui/Inventor/Draggers/Gizmo.cpp index ad6bba3988..81f3e020aa 100644 --- a/src/Gui/Inventor/Draggers/Gizmo.cpp +++ b/src/Gui/Inventor/Draggers/Gizmo.cpp @@ -178,9 +178,8 @@ SoLinearDraggerContainer* LinearGizmo::getDraggerContainer() void LinearGizmo::setProperty(QuantitySpinBox* property) { - if (quantityChangedConnection) { - QuantitySpinBox::disconnect(quantityChangedConnection); - } + QuantitySpinBox::disconnect(quantityChangedConnection); + QuantitySpinBox::disconnect(formulaDialogConnection); this->property = property; quantityChangedConnection = QuantitySpinBox::connect( @@ -189,7 +188,7 @@ void LinearGizmo::setProperty(QuantitySpinBox* property) setDragLength(value); } ); - quantityChangedConnection = QuantitySpinBox::connect( + formulaDialogConnection = QuantitySpinBox::connect( property, &Gui::QuantitySpinBox::showFormulaDialog, [this] (bool) { // This will set the visibility of the actual geometry to true or false @@ -452,9 +451,8 @@ void RotationGizmo::orientAlongCamera(SoCamera* camera) void RotationGizmo::setProperty(QuantitySpinBox* property) { - if (quantityChangedConnection) { - QuantitySpinBox::disconnect(quantityChangedConnection); - } + QuantitySpinBox::disconnect(quantityChangedConnection); + QuantitySpinBox::disconnect(formulaDialogConnection); this->property = property; quantityChangedConnection = QuantitySpinBox::connect( @@ -463,7 +461,7 @@ void RotationGizmo::setProperty(QuantitySpinBox* property) setRotAngle(value); } ); - quantityChangedConnection = QuantitySpinBox::connect( + formulaDialogConnection = QuantitySpinBox::connect( property, &Gui::QuantitySpinBox::showFormulaDialog, [this] (bool) { // This will set the visibility of the actual geometry to true or false diff --git a/src/Gui/Inventor/Draggers/Gizmo.h b/src/Gui/Inventor/Draggers/Gizmo.h index a87a98ff19..9a7dc8e5f1 100644 --- a/src/Gui/Inventor/Draggers/Gizmo.h +++ b/src/Gui/Inventor/Draggers/Gizmo.h @@ -85,7 +85,6 @@ protected: double initialValue; bool visible = true; - bool hasExpression = false; }; class GuiExport LinearGizmo: public Gizmo @@ -115,6 +114,7 @@ private: SoLinearDragger* dragger = nullptr; SoLinearDraggerContainer* draggerContainer = nullptr; QMetaObject::Connection quantityChangedConnection; + QMetaObject::Connection formulaDialogConnection; void draggingStarted(); void draggingFinished(); @@ -160,6 +160,7 @@ private: LinearGizmo* linearGizmo = nullptr; bool automaticOrientation = false; QMetaObject::Connection quantityChangedConnection; + QMetaObject::Connection formulaDialogConnection; void draggingStarted(); void draggingFinished();