Ikky
Ikky

Reputation: 2856

Qt: How do i set the height on a Vertical layout?

I'm having trouble using the layout manager system with Qt. This is going to be a Symbian app, so it should resize to different devices. This is done by using the Layouts.

On the image below I used the Vertical Layout, but I don't understand how I can decide how much each cell should take in width and height.

I want the blue to be a top label background, but I don't want it to be as high as it is now.

Does anyone know how I can do this? (I'm new to Qt :))

Qt layout design

Upvotes: 1

Views: 13461

Answers (1)

0xbaadf00d
0xbaadf00d

Reputation: 2643

You can set the maximum size for a widget by right clicking it and selecting 'Size Constraints'. Under that menu you can find actions that allow you to set the current displayed size as the maximum / minimum size for vertical / horizontal or both directions.

You can also set the numbers by hand by selecting the widget and by setting the number in the 'Property Editor'. They should be under the QWidget properties.

You cannot set the Height of a vertical layout directly, but you can set the height of the widget in which the vertical layout is.

If you want to split your Widgets so that the top widget takes 33.33% of the space, use the Stretch values. Set the top widget to 1 and the bottom widget to 2.

Upvotes: 7

Related Questions