X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetPoint2dDistance.cpp;h=829380cef043548846458c274782a0df8eecb46f;hb=0d9a107853208317a6352bb7f8c77eb54d5efbe1;hp=297727d4e57f314a049446147b8234ac0937b613;hpb=1105bfe31c0304ffacd85363d070322049d564f1;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index 297727d4e..829380cef 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -6,7 +6,6 @@ #include "PartSet_WidgetPoint2dDistance.h" #include "PartSet_Tools.h" -#include "PartSet_LockApplyMgr.h" #include #include @@ -29,16 +28,7 @@ PartSet_WidgetPoint2dDistance::PartSet_WidgetPoint2dDistance(QWidget* theParent, const std::string& theParentId) : ModuleBase_WidgetDoubleValue(theParent, theData, theParentId), myWorkshop(theWorkshop) { - myLockApplyMgr = new PartSet_LockApplyMgr(theParent, myWorkshop); - myFirstPntName = theData->getProperty("first_point"); - - // Reconnect to local slot - // Apply widget value change by enter/tab event. - //disconnect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged())); - //connect(mySpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValuesChanged())); - disconnect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged())); - connect(mySpinBox, SIGNAL(editingFinished()), this, SLOT(onValuesChanged())); } PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance() @@ -77,19 +67,16 @@ void PartSet_WidgetPoint2dDistance::activateCustom() this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*))); connect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)), this, SLOT(onMouseRelease(ModuleBase_IViewWindow*, QMouseEvent*))); - - myLockApplyMgr->activate(); } 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*))); - - myLockApplyMgr->deactivate(); } void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) @@ -125,12 +112,20 @@ void PartSet_WidgetPoint2dDistance::onMouseMove(ModuleBase_IViewWindow* theWnd, PartSet_Tools::convertTo2D(aPoint, mySketch, theWnd->v3dView(), aX, aY); std::shared_ptr aPnt = std::shared_ptr(new GeomAPI_Pnt2d(aX, aY)); + bool isBlocked = blockValueState(true); setPoint(feature(), aPnt); + blockValueState(isBlocked); + setValueState(ModifiedInViewer); } -void PartSet_WidgetPoint2dDistance::onValuesChanged() +bool PartSet_WidgetPoint2dDistance::processEnter() { - myLockApplyMgr->valuesChanged(); - emit valuesChanged(); + //bool isModified = mySpinBox->isModified(); + bool isModified = getValueState() == ModifiedInPP; + if (isModified) { + emit valuesChanged(); + //mySpinBox->clearModified(); + mySpinBox->selectAll(); + } + return isModified; } -