]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2400: The bug appears because of unsynchronized selection in viewer and object...
authorvsv <vsv@opencascade.com>
Fri, 12 Jan 2018 11:05:58 +0000 (14:05 +0300)
committervsv <vsv@opencascade.com>
Fri, 12 Jan 2018 11:05:58 +0000 (14:05 +0300)
src/XGUI/XGUI_ModuleConnector.cpp

index 34b7d462c7c6c6a1a84d929c7873d2b386ae8cac..4f2130509984d134c0c2bf2190fe2b48febe0670 100644 (file)
@@ -29,6 +29,7 @@
 #include "XGUI_PropertyPanel.h"
 #include "XGUI_ActionsMgr.h"
 #include "XGUI_ErrorMgr.h"
+#include "XGUI_ObjectsBrowser.h"
 
 #include <ModuleBase_IModule.h>
 #include <ModuleBase_ViewerPrs.h>
@@ -118,10 +119,21 @@ ObjectPtr XGUI_ModuleConnector::findPresentedObject(const AISObjectPtr& theAIS)
 void XGUI_ModuleConnector::setSelected(const QList<ModuleBase_ViewerPrsPtr>& theValues)
 {
   XGUI_Displayer* aDisp = myWorkshop->displayer();
+  XGUI_ObjectsBrowser* aBrowser = myWorkshop->objectBrowser();
   if (theValues.isEmpty()) {
     myWorkshop->selector()->clearSelection();
-  } else
+    aBrowser->treeView()->clearSelection();
+  } else {
     aDisp->setSelected(theValues);
+    // Synchronise the selection with Object browser
+    QObjectPtrList anObjects;
+    foreach(ModuleBase_ViewerPrsPtr aVal, theValues) {
+      anObjects.append(aVal->object());
+    }
+    bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true);
+    aBrowser->setObjectsSelected(anObjects);
+    myWorkshop->objectBrowser()->blockSignals(aBlocked);
+  }
 }
 
 void XGUI_ModuleConnector::setStatusBarMessage(const QString& theMessage)