[Qt-interest] QVBoxLayout widget spacing

Harold Hausman hhausman at gmail.com
Sat May 1 22:27:04 CEST 2010


Hi,

I'm trying to use a QVBoxLayout to lay out some custom widgets I've
created and I have some questions.

The custom widgets have a fixed height, as in setFixedHeight( 200 ).
When I add the first widget to the QVBoxLayout, it lays it out in the
middle of the layouts's area (the layout is taller than the widget I'm
adding in). This isn't what I want.

I'd like the layout to instead add the widget at the top of the
layout. Is there a way to set it up to do this? Essentially, instead
of evenly spacing the child widgets out, I'd like the layout to just
use the available space from top to bottom as widgets are added (with
all the unused space collected at the bottom).

Thanks in advance for any insight,
-Harold



More information about the Qt-interest-old mailing list