How to set display coefficient between widgets in Qt layout?

On the tab page, I have one tree view widget and one tab widget inside the vertical layout, I want to set 60% of the screen space in the tree view and 40% on the tab widget, always. How can I do this in Qt Designer?

Platform: Qt Creator 2.4.1 / Win 7.

+6
source share
1 answer

If you click on the parent widget and scroll through its properties, you will find the properties of its layout at the very bottom.

You can set the layoutRowStretch and layoutColumnStretch . In the case of vertical layout, you can, for example, set "60.40" (or "6.4" or "3.2") as the value for the layoutRowStretch property.

This will mean that the coefficient of the first row in the second row will be 60:40 = 3: 2

+5
source

Source: https://habr.com/ru/post/920773/


All Articles