[Qt-interest] Can't resize widget
Tom Panning
lurchvt at gmail.com
Wed Dec 17 17:24:29 CET 2008
On Mon, Dec 15, 2008 at 3:33 PM, Frank Mertens <frank at cyblogic.de> wrote:
> Rafael March wrote:
> > Hi all,
> >
> > I have a QVBoxLayout in my panel, and I'm adding a QListWidget to one of
> the boxes. I would like to resize this list, to make it smaller. I've
> already tried using list->resize(int,int) and
> list->setSizeIncrement(int,int), but none of these works ! The list remain
> at the same size !
> >
>
> The layout has taken control over the size.
>
> Depending on your problem you could have
>
> a) a minimum size constraint (QWidget::setMinimumSize())
> b) an aesthetic ratio (QBoxLayout::setStretchFactor())
> c) no need for automatic layouts at all (QWidget::setGeometry())
>
I would add:
d) incorrect size policies (QWidget::setSizePolicy()). You probably want to
have the QListWidget have a size policy of Preferred, and at least one of
the other widgets in the layout needs a size policy of Expanding or
MinimumExpanding.
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081217/dd18b35d/attachment.html
More information about the Qt-interest-old
mailing list