PDA

View Full Version : How to layout verticalyl two widgets in a fiz % ratio.



tonnot
3rd August 2011, 10:09
I have 2 widgets. I'd want to have the 40% of vertical space for the first and the remainder for the second.
And, pleas, can anybody explain me the strecht values ? Maybe it can be useful to do what I want ?
Thanls

stampede
3rd August 2011, 10:34
Stretch values represents the amount of total available space that will be assigned to each widget, for example if you have two widgets in a box layout and set stretch values 1 and 3, then layout manager will try to divide the available space such that second widget gets 3x more the space than first - so first will get 25% of total available space.
You can think about this values as : 1 part for first widget, 3 parts for second.
---
this is explained with an example in documentation: Layout Management : Stretch Factors (http://doc.qt.nokia.com/4.7-snapshot/layout.html#stretch-factors)