// if the restored value should be hidden, aDone = true to set
// reset state for the widget in the parent
aDone = restoreCurentValue();
+ emit objectUpdated();
}
else
aDone = ModuleBase_WidgetDoubleValue::resetCustom();
return theCurrentPnt->distance(theFirstPnt);
}
-void PartSet_WidgetPoint2dDistance::activateCustom()
-{
- ModuleBase_IViewer* aViewer = myWorkshop->viewer();
- connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
- connect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)));
-}
-
-void PartSet_WidgetPoint2dDistance::deactivate()
-{
- ModuleBase_ModelWidget::deactivate();
- ModuleBase_IViewer* aViewer = myWorkshop->viewer();
- disconnect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
- disconnect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)),
- this, SLOT(onMouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)));
-}
-
-void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
+void PartSet_WidgetPoint2dDistance::mouseReleased(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
{
// the contex menu release by the right button should not be processed by this widget
if (theEvent->button() != Qt::LeftButton)
setPoint(feature(), aPnt);
// if the validator of the control returns false, focus should not be switched
- if (getError().isEmpty())
+ if (getError(false).isEmpty())
emit focusOutWidget(this);
}
-void PartSet_WidgetPoint2dDistance::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
+void PartSet_WidgetPoint2dDistance::mouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
{
if (isEditingMode())
return;