From: vsv Date: Fri, 10 Apr 2015 12:02:01 +0000 (+0300) Subject: Improve multi-selection control X-Git-Tag: V_1.1.0~51^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a62ca8b3467dca12005f88a209fafed705a3d368;p=modules%2Fshaper.git Improve multi-selection control --- diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 9d74cc2fb..53f035275 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -282,11 +282,10 @@ void ModuleBase_WidgetMultiSelector::onSelectionChanged() } } } + 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); - - emit valuesChanged(); } //******************************************************************** @@ -334,6 +333,8 @@ void ModuleBase_WidgetMultiSelector::updateSelectionList(AttributeSelectionListP AttributeSelectionPtr aAttr = theList->value(i); myListControl->addItem(aAttr->namingName().c_str()); } + // We have to call repaint because sometimes the List control is not updated + myListControl->repaint(); } //******************************************************************** diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index d920f4630..0eff27bb2 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -46,7 +46,7 @@ const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse //#define DEBUG_DISPLAY //#define DEBUG_ACTIVATE //#define DEBUG_FEATURE_REDISPLAY -#define DEBUG_SELECTION_FILTERS +//#define DEBUG_SELECTION_FILTERS // Workaround for bug #25637 void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList) @@ -707,7 +707,13 @@ void XGUI_Displayer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilte if (theFilter.Access() == aIt.Value().Access()) return; } - GetFilter()->Add(theFilter); + Handle(SelectMgr_CompositionFilter) aCompFilter = GetFilter(); + const SelectMgr_ListOfFilter& aStoredFilters = aCompFilter->StoredFilters(); + for (aIt.Initialize(aStoredFilters); aIt.More(); aIt.Next()) { + if (theFilter.Access() == aIt.Value().Access()) + return; + } + aCompFilter->Add(theFilter); #ifdef DEBUG_SELECTION_FILTERS int aCount = GetFilter()->StoredFilters().Extent(); qDebug(QString("addSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str());