From f9f2bf6e73ced04457992cb16e7cc53ba686e198 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 8 Dec 2015 15:32:46 +0300 Subject: [PATCH] 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. --- src/PartSet/PartSet_WidgetPoint2d.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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*)), -- 2.39.2