Grid layout column width
-
wrote on 15 Feb 2021, 20:05 last edited by
Hi,
I have just started using qt creator and I am very impressed so far. I have managed to do in a couple of hours what took me more than a day with wxwidgets.
I am trying to apply a layout to my form. I have a group of controls in grid and then a tab control. I would like the group of controls to have a fixed width and height but the tab control to grow and shrink with the form
| | |
| | |
| controls | tabs |
| | |
| | |
| | |However, when I apply a grid layout to the form it always puts the two parts in columns with the same size in the designer. Is there a way to have individually sized columns in the designer?
Sorry is it a really obvious question,
Thanks in advance,
Martyn
-
Hi,
I have just started using qt creator and I am very impressed so far. I have managed to do in a couple of hours what took me more than a day with wxwidgets.
I am trying to apply a layout to my form. I have a group of controls in grid and then a tab control. I would like the group of controls to have a fixed width and height but the tab control to grow and shrink with the form
| | |
| | |
| controls | tabs |
| | |
| | |
| | |However, when I apply a grid layout to the form it always puts the two parts in columns with the same size in the designer. Is there a way to have individually sized columns in the designer?
Sorry is it a really obvious question,
Thanks in advance,
Martyn
wrote on 16 Feb 2021, 03:25 last edited by@MartynWheeler said in Grid layout column width:
Is there a way to have individually sized columns in the designer?
The layout takes care of your widget according to your layout and size policies.
But you can set a stretch factor. This will in- or decrease the size proportional to your other elements (e.g. twice as big).
For example you can divide the layout into e.g. 9 parts and let one widget take 2/9, one 6/9, and one 1/9 -
wrote on 16 Feb 2021, 08:40 last edited by
Thanks, that has fixed the issue
1/3