From ce62f70ac6042b1f4dacb10e0a8c6e8da089b3d3 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 28 Oct 2011 13:45:51 +0000 Subject: [PATCH] Fix method to find view from Python (previous implementation does not worked with just created windows) --- src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 31de3fd94..023840207 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -2107,19 +2107,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