PDA

View Full Version : Expandable Layout



adskol
25th January 2007, 04:56
I'm pretty new to QT. I feel like this is likely a simple question.

I've created a MainWindow (using QT Designer 4.2.2) which contains a number of widgets including TabWidgets containing labels and progress bars, a group box containing radio buttons, sliders, lineEdits, etc. I would like the window to rescale in a gracefull way. E.g. the sliders, progress bars would scale as the window grows and shrinks, but the lineEdits, labels, and distance between the radio buttons would remain constant.

As I have the layout currently, nothing scales (expands or compresses). I've selecting all objects (ctl-a) and layed them out in a grid, but that also results in none of the widgets scaling as I had hoped.

Any advice would be much appreciated.

Andrew

jpn
25th January 2007, 06:36
You are missing a top level layout. Deselect all widgets, open up context menu over the background of the form, and select a layout from there.

adskol
25th January 2007, 23:47
Thanks, that was extremely useful.

As a note to those who may be experiencing similar issues, if you have TabWidget that have items you want to expand appropriately, you must go to each tab, select the background and choose layout as grid. After you have layed out each tab in your TabWidgets, you must then select the background of the MainWindow and layout items in a grid.

Thanks again for your help.

Andrew