PDA

View Full Version : groupbox scale to contents height in qtdesigner



botnet
27th April 2014, 23:19
im just getting started with qt and ive got an application containing lots of groupboxes in a window, which need to be as large as posible, but only as tall as they need to be to fit their contents, which will vary in size. obviously i could do this in code quite easily but it would be far neater to put that behaviour in via the designer, i just cant seem to see an obvious way of doing it.

im using qt designer version 4.8.2

ChrisW67
27th April 2014, 23:33
You use the same properties on layouts/widgets in Designer as you would implement in code to achieve a size that is fixed by the size hint of the contained widgets. What have you tried?

botnet
27th April 2014, 23:45
not much, all i saw was pixel based sizing options, and lay out vertically option in the container widget

ChrisW67
27th April 2014, 23:58
You are looking for size constraints on the layout applied to each group box content, and on the layout that contains the group boxes.

See the "Extension Example" in Assistant for a mechanism that has the content control the size of the container (rather than the more typical container controlling its content).