From: vsv Date: Fri, 12 Jan 2018 11:05:58 +0000 (+0300) Subject: Issue #2400: The bug appears because of unsynchronized selection in viewer and object... X-Git-Tag: V_3.0.0RC1~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9ba657869c431869e6135bd26ba52ae63f964e8b;p=modules%2Fshaper.git Issue #2400: The bug appears because of unsynchronized selection in viewer and object browser --- diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index 34b7d462c..4f2130509 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -29,6 +29,7 @@ #include "XGUI_PropertyPanel.h" #include "XGUI_ActionsMgr.h" #include "XGUI_ErrorMgr.h" +#include "XGUI_ObjectsBrowser.h" #include #include @@ -118,10 +119,21 @@ ObjectPtr XGUI_ModuleConnector::findPresentedObject(const AISObjectPtr& theAIS) void XGUI_ModuleConnector::setSelected(const QList& 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)