From: vsr Date: Fri, 28 Oct 2011 13:45:51 +0000 (+0000) Subject: Fix method to find view from Python (previous implementation does not worked with... X-Git-Tag: V6_4_0a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ce62f70ac6042b1f4dacb10e0a8c6e8da089b3d3;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; } }