PDA

View Full Version : Qt Layout engine not respecting minimum size?



Mike
28th August 2007, 08:46
Hi,

I use Qt 4.3.1 and created several dialogs with it. I place some groupboxes and other widgets on the form and then apply the layout. The following strange things I have seen:
GroupBox Layout:
I have a picture, a lable and a horizontal stretch in a horizontal layout, as one item. I have several of those vertivally stacked in the groupbox. Now I adjust the groupbox to fit the content just right. I have set the items so that they request minimum size. But as soon as the groupbox does get it's layout assigned, each item is becoming wider. That of course than has impact on the whole dialog itself, which I would like to start nicely packed to it's minimum size. It doesn't seem to be working. The dialogs always start in some sort of wasted space mode.

Anyone seeing something like this? How can I make my dialogs show packed to minimum size to start with, and still use the layout engine for resizable dialogs?

Regards,
Michael

marcel
28th August 2007, 08:53
Try filling the space you want empty with spacers( that is if I understand your problem correctly).

Otherwise, try posting some code.

Regards

darksaga
28th August 2007, 13:27
try to set the horizontal sizepolicy of all items inside your groupbox to


QSizePolicy::Maximum


doing this, the groupbox should always try to stay at a minimum size