From: lls Date: Wed, 9 Nov 2011 12:37:43 +0000 (+0000) Subject: Patch for closing viewers with embedded Qt widgets X-Git-Tag: PPGP_V0_1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=58379fcfb969fff7bd309ed2249b666d095aea1d;p=modules%2Fgui.git Patch for closing viewers with embedded Qt widgets --- diff --git a/src/LightApp/LightApp_WgViewModel.cxx b/src/LightApp/LightApp_WgViewModel.cxx index cd4d7abb7..3b6a89e82 100644 --- a/src/LightApp/LightApp_WgViewModel.cxx +++ b/src/LightApp/LightApp_WgViewModel.cxx @@ -44,7 +44,6 @@ SUIT_ViewWindow* LightApp_WgViewModel::createView( SUIT_Desktop* d ) vw = new SUIT_ViewWindow( d ); vw->setCentralWidget( myWidget ); myCreated = true; - vw->setClosable( false );/////////////////// } return vw; } diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 014b88d9c..3429ec9b8 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -2157,19 +2157,18 @@ static SUIT_ViewWindow* getWnd( const int id ) { SUIT_ViewWindow* resWnd = 0; - LightApp_Application* app = getApplication(); + LightApp_Application* app = getApplication(); if ( app ) { - STD_TabDesktop* tabDesk = dynamic_cast( app->desktop() ); - if ( tabDesk ) + ViewManagerList vmlist = app->viewManagers(); + foreach( SUIT_ViewManager* vm, vmlist ) { - QList wndlist = tabDesk->windows(); - SUIT_ViewWindow* wnd; - foreach ( wnd, wndlist ) + QVector vwlist = vm->getViews(); + foreach ( SUIT_ViewWindow* vw, vwlist ) { - if ( id == wnd->getId() ) + if ( id == vw->getId() ) { - resWnd = wnd; + resWnd = vw; break; } }