X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetPoint2dDistance.cpp;h=427efc273fe8dd552c6718d67ffc9d69317a31ed;hb=09dabb6acd9664f589a0bd9415d804d7a37ab801;hp=9e92051b7964bace54cb3943faae3cf5215c1b58;hpb=8abdbb054d2e130d01aaf11ee6d5b984ce1e0b71;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index 9e92051b7..427efc273 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -28,18 +29,24 @@ PartSet_WidgetPoint2dDistance::PartSet_WidgetPoint2dDistance(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_WidgetDoubleValue(theParent, theData, theParentId), myWorkshop(theWorkshop), + const Config_WidgetAPI* theData) +: ModuleBase_WidgetDoubleValue(theParent, theData), myWorkshop(theWorkshop), myValueIsCashed(false), myIsFeatureVisibleInCash(true), myValueInCash(0) { myFirstPntName = theData->getProperty("first_point"); + myWidgetValidator = new ModuleBase_WidgetValidator(this, myWorkshop); } PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance() { } +bool PartSet_WidgetPoint2dDistance::isValidSelectionCustom( + const std::shared_ptr& theValue) +{ + return false; +} + bool PartSet_WidgetPoint2dDistance::resetCustom() { bool aDone = false; @@ -51,6 +58,7 @@ bool PartSet_WidgetPoint2dDistance::resetCustom() // 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(); @@ -120,7 +128,7 @@ void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWn 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); }