]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #460: the correct clearing of the layout to set the row stretch to default...
authorasl <asl@opencascade.com>
Thu, 13 Aug 2015 08:00:20 +0000 (11:00 +0300)
committerasl <asl@opencascade.com>
Thu, 13 Aug 2015 08:00:35 +0000 (11:00 +0300)
src/ModuleBase/ModuleBase_PageBase.cpp

index 027150f22426c45f4538ea262119d8399c3abe91..f7057783e2633f072be18742f01f11fdd0b6f77f 100644 (file)
@@ -48,6 +48,20 @@ void ModuleBase_PageBase::clearPage()
       delete aChild;
     }
   }
+
+  // Issue #460: this patch is necessary since the row stretch information
+  // is stored independently on the items: when the items are removed
+  // from the layout the stretch information is kept, so in the next 
+  // filling of the layout some "additional" (old) rows may be stretched
+  // without necessity. 
+  // In this patch we clear the stretch information specifying the default value: 0.
+  QGridLayout* aLayout = dynamic_cast<QGridLayout*>( pageLayout() );
+  if( aLayout )
+  {
+    int r = aLayout->rowCount();
+    for( int i=0; i<r; i++ )
+      aLayout->setRowStretch( i, 0 );
+  }
   myWidgetList.clear();
 }