From: Ekaterina Sukhareva Date: Thu, 1 Feb 2024 17:08:54 +0000 (+0000) Subject: [CEA] Automatically expand tree in Object Browser X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=363de2be604b434b3659d468ba0462e429d7dc46;p=modules%2Fgui.git [CEA] Automatically expand tree in Object Browser --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index b1cb7e3bb..d72e414f5 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -599,6 +599,25 @@ bool LightApp_Application::activateModule( const QString& modName ) if ( objectBrowser()->root() != activeStudy()->root() ) objectBrowser()->setRoot( activeStudy()->root() ); updateObjectBrowser( true ); + + // expand SHAPERSTUDY data after leaving Shaper module + // bos #40645 [CEA] Automatically expand tree in Object Browser + if (actName == "Shaper") { + SUIT_AbstractModel* aModel = dynamic_cast(objectBrowser()->model()); + LightApp_Study* aStudy = dynamic_cast( activeStudy() ); + if (aModel && aStudy) { + DataObjectList aComps; + aStudy->root()->children(aComps); + for(auto aCompSUIT : aComps){ + LightApp_DataObject* aComp = dynamic_cast( aCompSUIT ); + if ( aComp && aComp->componentDataType() == "SHAPERSTUDY") { + QModelIndex anIndex = aModel->index(aComp); + objectBrowser()->treeView()->expand(anIndex); + break; + } + } + } + } } if ( activeModule() ) activeModule()->updateModuleVisibilityState();