]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2948: Synchronize selection for filters controls
authorvsv <vsv@opencascade.com>
Tue, 30 Jul 2019 09:57:32 +0000 (12:57 +0300)
committervsv <vsv@opencascade.com>
Tue, 30 Jul 2019 09:57:45 +0000 (12:57 +0300)
src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp

index d7e3d15de55f4ac2c4ae05977f78a62c77a9d51e..78b3bb708066db55164497604d02b2a6a603d149 100644 (file)
@@ -630,5 +630,20 @@ void ModuleBase_WidgetSelectionFilter::onObjectUpdated()
   myShowBtn->setChecked(false);
   clearCurrentSelection(true);
   updateNumberSelected();
+
+  QList<ModuleBase_FilterItem*> aItemsList = myFiltersWgt->findChildren<ModuleBase_FilterItem*>();
+  foreach(ModuleBase_FilterItem* aItem, aItemsList) {
+    QList<ModuleBase_ModelWidget*> aWidgetsList = aItem->widgets();
+    foreach(ModuleBase_ModelWidget* aWidget, aWidgetsList) {
+      if (!aWidget->feature().get())
+        aWidget->setFeature(myFeature);
+      aWidget->restoreValue();
+    }
+  }
   updateObject(myFeature);
+
+  // Redisplay the feature on order to Customize presentations from filters with selectors
+  static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  ModelAPI_EventCreator::get()->sendUpdated(myFeature, EVENT_DISP);
+  Events_Loop::loop()->flush(EVENT_DISP);
 }