PDA

View Full Version : Layout not giving space equally



gruszczy
2nd January 2009, 22:38
I would like a box layout not to give all widgets the same amout of space, but for example give one 40% and the other 60%. Is it easily achievable? I browsed the classes, but found no methods providing this functionality, but maybe there are some easy ways to do this?

wysota
2nd January 2009, 22:49
Yes, it's very simple. You want to change QSizePolicy::horizontalStretch() or QSizePolicy::verticalStretch() of widgets (they are also available in Designer if you use it). If you want 40/60 then set one widget's stretch to 2 and the other one's to 3 (or 4 and 6 or 40 and 60, I'm sure you get the point).