From d04d1bcc41a20e3afd64e26b25207aa6dce2afe6 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 25 Nov 2016 11:56:02 +0300 Subject: [PATCH] Issue #1749 Not updating the list "Selected objects" in the feature "Group" --- .../ModuleBase_WidgetMultiSelector.cpp | 22 ++++++++++++++----- .../ModuleBase_WidgetMultiSelector.h | 3 +++ 2 files changed, 20 insertions(+), 5 deletions(-) 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 -- 2.39.2