Results 1 to 2 of 2

Thread: QScrollView with a QVboxlayout

  1. #1
    Join Date
    Jan 2008
    Posts
    27
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QScrollView with a QVboxlayout

    I am trying to figure out if this is the right technique for what I want to do. I basically want a scrollable vertical box layout, but cannot seem to figure it out. The problem with using Vboxlayout is that is resizes the widgets I put in it, I want the size to be fixed with a scroll bar. This possible anyway? Been trying to figure this out for 2 days and still lost.

    Edit: Another thing is that I need to be able to add and remove widgets in real-time.

    Thanks

  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: QScrollView with a QVboxlayout

    Quote Originally Posted by rishid View Post
    I am trying to figure out if this is the right technique for what I want to do. I basically want a scrollable vertical box layout, but cannot seem to figure it out. The problem with using Vboxlayout is that is resizes the widgets I put in it, I want the size to be fixed with a scroll bar. This possible anyway? Been trying to figure this out for 2 days and still lost.
    Yes, it's possible. Just fill the layout, install on a widget and use QScrollArea::setWidget().

    Quote Originally Posted by rishid View Post
    Edit: Another thing is that I need to be able to add and remove widgets in real-time.
    Add the widget to the layout and call QWidget::adjustSize() on the container widget (not the scroll area widget but the widget that contains those child widgets).
    J-P Nurmi

Similar Threads

  1. Disappearing widgets in QVBoxLayout
    By torleifs in forum Newbie
    Replies: 1
    Last Post: 24th October 2007, 13:17
  2. QScrollView size policy?
    By Henrikas[MI] in forum Qt Programming
    Replies: 1
    Last Post: 19th November 2006, 10:52
  3. faster QScrollView
    By firas in forum Qt Programming
    Replies: 2
    Last Post: 29th April 2006, 18:49
  4. Subclassing QScrollView
    By sumsin in forum Qt Programming
    Replies: 13
    Last Post: 16th March 2006, 14:20
  5. How to find size provided by QScrollView
    By Sarma in forum Qt Programming
    Replies: 1
    Last Post: 7th March 2006, 09:26

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.