PDA

View Full Version : hide() and auto resizing



MrGarbage
25th August 2007, 03:05
Hi,

I am having some trouble getting some controls to resize correctly.
These have been built in QT designer.

I have attached 3 images.

Image 1 - When the small << button on the leftmost group control
is pressed I hide() the "Control" text label contained
in that group box as well as the underlying group box.

The result is shown in image 2.
I would like the grey group box containing the button
to shrink horizontally to the minimum width I have specified
but it's width does not change. If I hide the control altogether
the other control boxes do slide over to the left which is what I want.

The grey groupbox's hSizeType is Preferred and it has a minimumSize width
of 30.

Once the text is hidden, I would think the control would automatically
resize down but that doesn't happen.

Can someone explain why/how?

Also as shown in image 3 when the other Control box buttons are pressed
I hide their bottom group component. I would like the Control boxes
underneath to keep their size but move up to occupy the now empty vertical
space.

Any suggestions?

Thank you!

Mark



This is windows and QT 4.3

Any suggestions?

Many Thanks,
Mark

maverick_pol
25th August 2007, 09:40
Hi,

Could you attach your code I would play with on machine I try to help you.
There are still some people who do not need code to solve the problem :)

Maverick

jpn
25th August 2007, 09:44
To get a layout strictly follow size hint changes:

layout->setSizeConstraint(QLayout::SetFixedSize);