Salome HOME
Union of validator and filter functionalities.
[modules/shaper.git] / src / PartSet / PartSet_WidgetPoint2dDistance.cpp
index 756e9a8a91fb38bc694a42bfcd828b455df38830..0e40984766fc5af49890a7b32df41b298958473a 100644 (file)
@@ -44,9 +44,10 @@ PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance()
 void PartSet_WidgetPoint2dDistance::reset()
 {
   bool isOk;
-  double aDefValue = QString::fromStdString(myDefaultValue).toDouble(&isOk);
+  double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
 
   ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0);
+  storeValueCustom();
 }
 
 void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
@@ -89,6 +90,10 @@ void PartSet_WidgetPoint2dDistance::deactivate()
 
 void PartSet_WidgetPoint2dDistance::onMouseRelease(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)
+    return;
+
   gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWnd->v3dView());
 
   double aX, aY;