]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Patch for closing viewers with embedded Qt widgets
authorlls <lls@opencascade.com>
Wed, 9 Nov 2011 12:37:43 +0000 (12:37 +0000)
committerlls <lls@opencascade.com>
Wed, 9 Nov 2011 12:37:43 +0000 (12:37 +0000)
src/LightApp/LightApp_WgViewModel.cxx
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx

index cd4d7abb7c1c124aa059562d854b32ccbf282189..3b6a89e82b60e833527d4f896f5e2d2fed1cdfcd 100644 (file)
@@ -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;
 }
index 014b88d9c662eae0c7def5a2867529e18aa0a560..3429ec9b80261d13e1854f1497e2872df0adcaf4 100644 (file)
@@ -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<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;
         }
       }