From c81e2807e1293d6f35262a4de66ceb61d0322fda Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 24 Jun 2015 09:50:43 +0300 Subject: [PATCH] Focus regression in shape selector. Distance - select 1st object, focus is still on the first control --- src/ModuleBase/ModuleBase_WidgetSelector.cpp | 5 +++-- src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index 5a9ce330a..f4a4b456f 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -46,14 +46,15 @@ void ModuleBase_WidgetSelector::onSelectionChanged() QList aSelected = myWorkshop->selection()->getSelected( ModuleBase_ISelection::AllControls); - setSelection(aSelected); + bool isDone = setSelection(aSelected); emit valuesChanged(); // the updateObject method should be called to flush the updated sigal. The workshop listens it, // calls validators for the feature and, as a result, updates the Apply button state. updateObject(myFeature); - updateFocus(); + if (isDone) + updateFocus(); } //******************************************************************** diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index c455309d7..0064bcec1 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -182,9 +182,7 @@ QList ModuleBase_WidgetShapeSelector::getControls() const void ModuleBase_WidgetShapeSelector::updateFocus() { - ObjectPtr anObject = GeomValidators_Tools::getObject(myFeature->attribute(attributeID())); - if (anObject.get()) - emit focusOutWidget(this); + emit focusOutWidget(this); } //******************************************************************** -- 2.39.2