C++ (Qt)
void QMainWidget::UpdateLayout()
{
if( layout() )
delete layout();
QVBoxLayout* mainlayout = new QVBoxLayout;
mainlayout->setMargin(0);
mainlayout->setSpacing(0);
mainlayout->addWidget(header, 1); //Stretch factor = 1
mainlayout->addWidget(content, 20); //Stretch factor = 20, i.e. second cell of layout has size = WidgetHeight/22 * 18
mainlayout->addWidget(footer, 1); //Stretch factor = 1
setLayout(mainlayout);
}
Вот так?