[Qt-interest] Can't resize widget

Frank Mertens frank at cyblogic.de
Mon Dec 15 21:33:00 CET 2008


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 !
> 
> What's possibly wrong in my code ?
> 
> Regards,
> Rafael March.
> 
> 
> 

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())
...
but, Qt can do a lot more;)
...

--
Frank




More information about the Qt-interest-old mailing list