PDA

View Full Version : form not auto resizing



quickNitin
23rd November 2006, 09:45
this is in continuoation to post http://www.qtcentre.org/forum/f-newbie-4/t-setting-i-widgt-visibleinvisible-on-toggling-of-button-4550.html

Issue i am facing is auto resizing of this dialog.
I have put these widget in a grid layout ( tried other layout also).
I am wishing that my tab widgets remain of same size and whenever i try to display table widgets ,dialog form may enlarge/shorten correspondingily but this is not happening.
I was expecing layout to take care of this. I also tried wih some some size policy but couldn't get desired result.

quickNitin

jpn
23rd November 2006, 09:57
You are most likely missing the top level layout. Open up context menu over the dialog's background and select "Layout->Something" or alternatively do that from the Form-menu in the main menu bar (make sure you click on the dialogs background before so that no child widget is selected).

quickNitin
23rd November 2006, 10:14
widgets were already in grid layout and had done what you suggested. Ifound a example very similar to one i am doing except one line of code



layout()->setSizeContraints(QLayout::setFixedSize)


This line did the trick. What i understood from this code layout manager allows only that much space which is minimum require. After that it expands / shrinks accordingly. Senior members kindly comment.

quickNitin
23rd November 2006, 10:21
Also if i donot follow the steps what u had suggested , this line results in segmentation fault since layout() for that widgets returns 0.

anju123
7th June 2007, 09:47
Hi,
I was struggling with this problem for the last 2 days and your posting has helped me a lot. But this SetFixedSize confused a bit, although it fixes the size of dialog box but also resizes it to the enclosing widget's size.

Anju

wysota
7th June 2007, 10:00
But this SetFixedSize confused a bit, although it fixes the size of dialog box but also resizes it to the enclosing widget's size.

What's the point of having a fixed size dialog that doesn't show all its content?