X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_PageBase.cpp;h=ed9fb7694031d374eb4120e8ee216a60a9afe5bd;hb=8cd56d486b6e96b8814002f9f0f4acadd6cea11b;hp=027150f22426c45f4538ea262119d8399c3abe91;hpb=694482299ca580d780c221cc6a3e7574e59fd2c3;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_PageBase.cpp b/src/ModuleBase/ModuleBase_PageBase.cpp index 027150f22..ed9fb7694 100644 --- a/src/ModuleBase/ModuleBase_PageBase.cpp +++ b/src/ModuleBase/ModuleBase_PageBase.cpp @@ -40,15 +40,30 @@ void ModuleBase_PageBase::addPageWidget(ModuleBase_PageBase* thePage) void ModuleBase_PageBase::clearPage() { + myWidgetList.clear(); + QLayoutItem *aChild; while ((aChild = pageLayout()->takeAt(0)) != 0) { if(aChild->widget()) { - aChild->widget()->deleteLater(); + delete aChild->widget(); } else { delete aChild; } } - myWidgetList.clear(); + + // 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 ); + } }