From: vsr Date: Fri, 28 Oct 2011 13:44:22 +0000 (+0000) Subject: Fix method to find view from Python (previous implementation does not worked with... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FV6_3_BR;p=modules%2Fgui.git Fix method to find view from Python (previous implementation does not worked with just created windows) --- 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; } }