]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix method to find view from Python (previous implementation does not worked with... V6_3_BR
authorvsr <vsr@opencascade.com>
Fri, 28 Oct 2011 13:44:22 +0000 (13:44 +0000)
committervsr <vsr@opencascade.com>
Fri, 28 Oct 2011 13:44:22 +0000 (13:44 +0000)
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx

index 31de3fd94504019d7d45974fc0348226870398bc..023840207107315319b518036dc66128306013d4 100644 (file)
@@ -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<STD_TabDesktop*>( app->desktop() );
-    if ( tabDesk )
+    ViewManagerList vmlist = app->viewManagers();
+    foreach( SUIT_ViewManager* vm, vmlist )
     {
-      QList<SUIT_ViewWindow*> wndlist = tabDesk->windows();
-      SUIT_ViewWindow* wnd;
-      foreach ( wnd, wndlist )
+      QVector<SUIT_ViewWindow*> vwlist = vm->getViews();
+      foreach ( SUIT_ViewWindow* vw, vwlist )
       {
-        if ( id == wnd->getId() )
+        if ( id == vw->getId() )
         {
-          resWnd = wnd;
+          resWnd = vw;
           break;
         }
       }