How to make widget use maximum height
-
I'm using qt creator and designer to create an app, and so far I have in the MainWindow 4 things:
- a qtreeview
- a group box
- another group box
- a vertical spacer
The treeview is to the left and first groupbox is in the upper right corner, and the other box below and the spacer below that group box.
I selected each group box in turn and clicked "Lay out in a grid" and set "LayoutSizeConstraint" to "SetFixedSize" for them both, so they look very nice and keep their size when resizing the mainwindow.
Then I selected the central widget and clicked "Lay out in a grid".
Now the groupboxes are close to eachother and stay in the upper right corner when resizing the mainwindow, and the treeview changes size to fit as much as possible horrizontaly (great!) but how can I get it to scale vertically and use maximum height?
-
You need to modify sizePolicy of your QTreeView widget and set it to expanding in both directions.
-
Nice, thanks for sharing the solution