How to set display ratio between widgets in Qt layout?

让人想犯罪 __ 提交于 2020-08-19 04:20:03

问题


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

Platform: Qt Creator 2.4.1 / Win 7.


回答1:


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

You can set the layoutRowStretch and layoutColumnStretch properties there. In case of a vertical layout, you could for example set "60,40" (or "6,4" or "3,2") as value for the layoutRowStretch property.

This will mean the factor of the first row to the second row will be 60:40 = 3:2



来源:https://stackoverflow.com/questions/11535525/how-to-set-display-ratio-between-widgets-in-qt-layout

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!