PDA

View Full Version : Hide and Show problem in master layout



QPlace
3rd July 2009, 14:53
http://www.tradeplatform.us/LayoutQuestion.jpg

Fig.1 in the attached picture shows screen show of my dialog in Qt Designer.
When “Hide processor” button is clicked the hide/show of a top GroupBox processed as:

if (ui.gbGeneration->isVisible())
{
ui.btnShowHide->setText("Show processor");
ui.btnShowHide->setArrowType (Qt::ArrowType::DownArrow);
ui. gbGeneration ->hide();
}
else
{
ui.btnShowHide->setText("Hide processor");
ui.btnShowHide->setArrowType (Qt::ArrowType::UpArrow);
ui. gbGeneration ->show();
}

Prior to clicking “Hide Processor” button the dialog capture in run-time is shown on Fig.2. After hiding the group box the result capture is shown on Fig.3

My question: how to change dialog layout in such a way that the result of “hiding” will look like as shown on Fig.4?

Oh, and one more thing – this dialog is shown in QMdiSubWindow when window is maximized.
Any help will be greatly appreciated, 3.5 hours had been lost already 

lyuts
3rd July 2009, 15:58
What are the size policies of your dialog?

Lykurg
3rd July 2009, 16:04
Standard answer: use
layout()->setSizeConstraint(QLayout::SetFixedSize); inside you c-tor. (An example is on the wiki!)