From 676d468ad2d34eba5def482ef14158313d1bbaa5 Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 13 Aug 2015 11:00:20 +0300 Subject: [PATCH] Issue #460: the correct clearing of the layout to set the row stretch to default value --- src/ModuleBase/ModuleBase_PageBase.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ModuleBase/ModuleBase_PageBase.cpp b/src/ModuleBase/ModuleBase_PageBase.cpp index 027150f22..f7057783e 100644 --- a/src/ModuleBase/ModuleBase_PageBase.cpp +++ b/src/ModuleBase/ModuleBase_PageBase.cpp @@ -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( pageLayout() ); + if( aLayout ) + { + int r = aLayout->rowCount(); + for( int i=0; isetRowStretch( i, 0 ); + } myWidgetList.clear(); } -- 2.39.2