From: asl Date: Tue, 26 May 2015 07:38:28 +0000 (+0300) Subject: refs #551: incorrect visible status X-Git-Tag: v1.4.1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=41541efd8140fbc1195a915db59f20e87a2e3bc6;p=modules%2Fhydro.git refs #551: incorrect visible status --- diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index 9b9863db..44c63cd2 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -705,7 +705,12 @@ LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* treeModel = dynamic_cast( app->objectBrowser()->model() ); if ( treeModel ) - treeModel->setVisibilityState( aResObj->text( aResObj->customData( Qtx::IdType ).toInt() ), Qtx::HiddenState, false ); + { + HYDROGUI_Module* aModule = dynamic_cast( module() ); + bool isVisible = aModule->isObjectVisible( -1, theModelObject ); + Qtx::VisibilityState aVisState = isVisible ? Qtx::ShownState : Qtx::HiddenState; + treeModel->setVisibilityState( aResObj->text( aResObj->customData( Qtx::IdType ).toInt() ), aVisState, false ); + } } if ( theIsBuildTree ) diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 283f361e..95d4a590 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -951,6 +951,17 @@ bool HYDROGUI_Module::isObjectVisible( const int theViewId, if( theObject.IsNull() ) return false; + if( theViewId < 0 ) + { + //search in all + foreach( int aViewId, myObjectStateMap.keys() ) + { + if( isObjectVisible( aViewId, theObject ) ) + return true; + } + return false; + } + ViewId2Entry2ObjectStateMap::const_iterator anIter1 = myObjectStateMap.find( theViewId ); if( anIter1 != myObjectStateMap.end() ) {