From: nds Date: Fri, 25 Nov 2016 08:56:02 +0000 (+0300) Subject: Issue #1749 Not updating the list "Selected objects" in the feature "Group" X-Git-Tag: V_2.6.0~51 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d04d1bcc41a20e3afd64e26b25207aa6dce2afe6;p=modules%2Fshaper.git Issue #1749 Not updating the list "Selected objects" in the feature "Group" --- diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 8064ae31f..d2e8355f3 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -394,11 +394,8 @@ QList ModuleBase_WidgetMultiSelector::getControls() const void ModuleBase_WidgetMultiSelector::onSelectionTypeChanged() { activateSelectionAndFilters(true); - QList anEmptyList; - // This method will call Selection changed event which will call onSelectionChanged - // To clear mySelection, myListControl and storeValue() - // So, we don't need to call it - myWorkshop->setSelected(anEmptyList); + + clearSelection(); } //******************************************************************** @@ -548,6 +545,21 @@ std::string ModuleBase_WidgetMultiSelector::validatorType(const QString& theType return aType; } +//******************************************************************** +void ModuleBase_WidgetMultiSelector::clearSelection() +{ + bool isClearInNeutralPoint = myIsNeutralPointClear; + myIsNeutralPointClear = true; + + QList anEmptyList; + // This method will call Selection changed event which will call onSelectionChanged + // To clear mySelection, myListControl and storeValue() + // So, we don't need to call it + myWorkshop->setSelected(anEmptyList); + + myIsNeutralPointClear = isClearInNeutralPoint; +} + //******************************************************************** void ModuleBase_WidgetMultiSelector::onCopyItem() { diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h index d502e1506..1e61a581e 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h @@ -138,6 +138,9 @@ protected: /// For example, the "Edges" is converted to "edge" std::string validatorType(const QString& theType) const; + /// Clear selection in the viewer. The content of the widget is cleared also + void clearSelection(); + protected: /// Returns attribute indices selected in the widget selection list /// \param theIndices a list of indices