Salome HOME
"2.11 Constraint with a point from the intersection between an outer edge and plane...
[modules/shaper.git] / src / PartSet / PartSet_WidgetPoint2dDistance.cpp
index 829380cef043548846458c274782a0df8eecb46f..562604dc05578878b5ef62c137adebad2296788b 100644 (file)
@@ -95,7 +95,10 @@ void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWn
 
   std::shared_ptr<GeomAPI_Pnt2d> aPnt = std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(aX, aY));
   setPoint(feature(), aPnt);
-  emit focusOutWidget(this);
+
+  // if the validator of the control returns false, focus should not be switched
+  if (getError().isEmpty())
+    emit focusOutWidget(this);
 }
 
 void PartSet_WidgetPoint2dDistance::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
@@ -120,11 +123,9 @@ void PartSet_WidgetPoint2dDistance::onMouseMove(ModuleBase_IViewWindow* theWnd,
 
 bool PartSet_WidgetPoint2dDistance::processEnter()
 {
-  //bool isModified = mySpinBox->isModified();
   bool isModified = getValueState() == ModifiedInPP;
   if (isModified) {
     emit valuesChanged();
-    //mySpinBox->clearModified();
     mySpinBox->selectAll();
   }
   return isModified;