From: nds Date: Tue, 8 Dec 2015 12:32:46 +0000 (+0300) Subject: Correction for squish tests. This is a regression for avoid of initialization of... X-Git-Tag: V_2.1.0~208 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f9f2bf6e73ced04457992cb16e7cc53ba686e198;p=modules%2Fshaper.git Correction for squish tests. This is a regression for avoid of initialization of the line point in activate(). Erroneous case: Create lin(do not move over viewer), by tab change focus to the End point, input value. Alt+Tab to Start point. BUG: Apply is disabled. Start attribute is not initialized. --- diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index b10dd41cf..cd2de7748 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -286,6 +286,14 @@ bool PartSet_WidgetPoint2D::canBeActivatedByMove() void PartSet_WidgetPoint2D::deactivate() { + // the value of the control should be stored to model if it was not + // initialized yet. It is important when we leave this control by Tab key. + // It should not be performed by the widget activation as the preview + // is visualized with default value. Line point is moved to origin. + AttributePtr anAttribute = myFeature->data()->attribute(attributeID()); + if (anAttribute && !anAttribute->isInitialized()) + storeValue(); + ModuleBase_ModelWidget::deactivate(); ModuleBase_IViewer* aViewer = myWorkshop->viewer(); disconnect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),