From 34371dc71900bf80ebfff30718c72807bd2d726f Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 8 Dec 2020 17:57:48 +0300 Subject: [PATCH] Fix visibility state management in the Object Browser (eye sign) --- src/LightApp/LightApp_Application.cxx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 983648dcf..692e3a084 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -5181,7 +5181,7 @@ void LightApp_Application::emitOperationFinished( const QString& theModuleName, Update visibility state of given objects */ void LightApp_Application::updateVisibilityState( DataObjectList& theList, - SUIT_ViewModel* theViewModel ) + SUIT_ViewModel* theViewModel ) { if ( !theViewModel || theList.isEmpty() ) return; @@ -5196,19 +5196,17 @@ void LightApp_Application::updateVisibilityState( DataObjectList& theList, if ( !obj || aStudy->isComponent( obj->entry() ) ) continue; - LightApp_Module* anObjModule = dynamic_cast(obj->module()); - if ( anObjModule ) { - LightApp_Displayer* aDisplayer = anObjModule->displayer(); - if ( aDisplayer ) { - Qtx::VisibilityState anObjState = Qtx::UnpresentableState; - if ( aDisplayer->canBeDisplayed( obj->entry(), theViewModel->getType() ) ) { - if ( aView && aDisplayer->IsDisplayed( obj->entry(), aView ) ) - anObjState = Qtx::ShownState; - else - anObjState = Qtx::HiddenState; - } - aStudy->setVisibilityState( obj->entry(), anObjState ); + QString mod_name = moduleTitle(aStudy->componentDataType(obj->entry())); + LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(mod_name, false); + if ( aDisplayer ) { + Qtx::VisibilityState anObjState = Qtx::UnpresentableState; + if ( aDisplayer->canBeDisplayed( obj->entry(), theViewModel->getType() ) ) { + if ( aView && aDisplayer->IsDisplayed( obj->entry(), aView ) ) + anObjState = Qtx::ShownState; + else + anObjState = Qtx::HiddenState; } + aStudy->setVisibilityState( obj->entry(), anObjState ); } } } -- 2.39.2