Results 1 to 2 of 2

Thread: QVLayoutBox doesn't expand as widgets are added?

  1. #1
    Join Date
    Jul 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QVLayoutBox doesn't expand as widgets are added?

    Hi all,

    I have the following UI heirarchy:

    A QVBoxLayout is a child of the QScrollArea

    I want to add widgets in to the QVBoxLayout when a user pushes a button.

    Currently the system works but, as I add more widgets in to the QVBoxLAyout, the QVBoxLayout doesn't expand in size and the widgets are drawn closer and closer together until finally, they are not visible at all.

    Is there a method I need to call so that the QVBoxLayout grows as more widgets are added in to is?

    Thanks for any tips.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QVLayoutBox doesn't expand as widgets are added?

    Install the vbox layout on a plain QWidget and set it inside the scroll area with QScrollArea::setWidget(). Call QWidget::adjustSize() on that widget after adding new widgets.
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.