]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Sometimes when base widget of QtxWorkstackChild is removed it nullifies myWidget...
authorsln <sln@opencascade.com>
Mon, 25 Apr 2011 10:31:36 +0000 (10:31 +0000)
committersln <sln@opencascade.com>
Mon, 25 Apr 2011 10:31:36 +0000 (10:31 +0000)
Now protection is provided. If QtxWorkstackChild receives event about deletion of its base widget it removes it clears its layout. Also all processEvents() emthods call are commented in DiagramGUI_Module.

src/Qtx/QtxWorkstack.cxx

index 566b2953f112549f5422dbcdf4629238f00c242d..5ad12139ce17a753ace46f9323d3f7c5736654b5 100644 (file)
@@ -1236,7 +1236,15 @@ void QtxWorkstackChild::onDestroyed( QObject* obj )
 {
   if ( obj != widget() )
     return;
-
+  
+  QLayout* lay = layout();
+  if ( lay )
+  {
+    QLayoutItem* item =        lay->takeAt( 0 );
+    if ( item )
+      lay->removeItem( item );
+  }
+  
   myWidget = 0;
   deleteLater();
 }
@@ -1249,6 +1257,14 @@ void QtxWorkstackChild::childEvent( QChildEvent* e )
 {
   if ( e->removed() && e->child() == widget() )
   {
+    QLayout* lay = layout();
+    if ( lay )
+    {
+      QLayoutItem* item =      lay->takeAt( 0 );
+      if ( item )
+        lay->removeItem( item );
+    }
+
     myWidget = 0;
     deleteLater();
   }