From 58379fcfb969fff7bd309ed2249b666d095aea1d Mon Sep 17 00:00:00 2001 From: lls Date: Wed, 9 Nov 2011 12:37:43 +0000 Subject: [PATCH] Patch for closing viewers with embedded Qt widgets --- src/LightApp/LightApp_WgViewModel.cxx | 1 - src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) 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; } } -- 2.39.2