PDA

View Full Version : QLayout question



zgulser
25th March 2012, 20:06
Hi,

Suppose that we have a QHBoxLayout and inside it;

1. we have 2 inner QVBoxLayouts

2. QSpacerItem(with "expanding" size policy) between those 2 QVBoxLayouts

I wonder how parent QHBoxLayout organizes those three things? How inner boxlayouts resized relative to qspacer?

Not: QSpacerItem has expanding size policy and inner layouts have sizeDefaultConstraint

Thanks in advance.

wysota
25th March 2012, 21:03
I wonder how parent QHBoxLayout organizes those three things? How inner boxlayouts resized relative to qspacer?
It depends on size policies of the objects in question.

zgulser
25th March 2012, 22:03
I actually wanted to ask how layout treats inner layouts along with other widgets inside it when resizing is performed.

Widgets have size policy but layouts are a bit different(i.e. sizeDefaultConstraint). That's why I asked the question.

wysota
25th March 2012, 22:10
This is a hierarchy. The layout behaves according to its contents. If the contents means more layouts, they are being looked into. In the end it's widgets that matter. You can experiment by launching Qt Designer, forming hierarchies of widgets and layouts and resizing the top-level window to see how the space is being managed.