[Qt-interest] Reasoning behind size-policy difference betweenlayout and splitter?

K. Frank kfrank29.c at gmail.com
Sat Mar 27 23:25:12 CET 2010


Scott -

Thanks fore the reply.

On Sat, Mar 27, 2010 at 11:44 AM, Scott Aron Bloom
<Scott.Bloom at onshorecs.com> wrote:
> Try this...
>
> In case one, you have 2 vertical layouts, one on the pairs, and then one
> on the main widget...
>
> Make it 1 big vertical on the main widget, it should at like the
> splitter...

I don't think I understand exactly what you are saying.  I do have, as you say,
two vertical layouts.  But the "extra" layout, which I suppose is redundant,
doesn't seem to have any effect.

Specifically, I have my two QPushButton's grouped together in a horizontal
layout, and my two QTableView's grouped together in a separate horizontal
layout.  Now if I add only one vertical layout to the main widget -- by this I
mean that I am creating a form in Qt designer based on a QWidget, and I
right click in an empty area of the QWidget's background and select

   Lay out / Lay Out Vertically

I get the same behavior in which the QPushButton's expand vertically along
with the QTableView's.

In fact, as near as I can tell, this case, where I have a single
vertical layout,
and the case in my previous posting, where I have two vertical layouts,
behave exactly the same way.

I'm still confused by this resizing stuff.  There are lots of instances where
the resizing behavior is not what I would "expect", and when I look through
the documentation, I can't figure out why things behave the way they do.

That's why I think I must be misunderstanding some part of the resizing
design logic.

Thanks.


K. Frank

>
> Scott
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
>
> Hello All -
> ...
> I then group the pair of QPushButton's and the pair of QTableView's into
> a vertical layout, and then apply a vertical layout to the top-level
> widget.
> ...
> In case b (the QTableView's are in a horizontal splitter), I get (for
> me) unexpected
> behavior:  both the QPushButton's and the QTableView's expand
> vertically,
> and end up taking about the same amount of space.
> ...
> Thanks.
>
> K. Frank




More information about the Qt-interest-old mailing list