Results 1 to 6 of 6

Thread: Scrollable QLayout

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Scrollable QLayout

    Hi! I created a toolbar where I add buttons in a QVBoxLayout. It happens that the QVBoxLayout cannot place all the buttons inside the layout. Would it be possible to insert the layout in a QScrollArea so that, in case the layout cannot place all the buttons, it automatically creates the scrollbar to scroll the buttons?
    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Scrollable QLayout

    Did you try it?

  3. #3
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Scrollable QLayout

    What? Placing all the buttons? Yes, it resizes the buttons, but I can't allow this.

  4. #4
    Join Date
    Jul 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Scrollable QLayout

    I have similar kind of situation where instead of buttons I have widgets but not listWidgets. Does anyone have any idea how it can be done.

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollable QLayout

    You can set the size policy of the buttons so that they dont increase in size.
    QScrollArea should be fine.

  6. #6
    Join Date
    Jul 2010
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollable QLayout

    I did something similar to this with checkboxes...

    I ended up putting a QFrame inside a QScrollArea... Adding a vbox layout to the frame and then adding my checkboxes to the layout gave the results that you are looking for...

    I'm kind of new to Qt though so others might know a better way to do it...

Similar Threads

  1. Scrollable Panel
    By qtoptus in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2010, 10:07
  2. QWidget Scrollable
    By prasenjit in forum Newbie
    Replies: 1
    Last Post: 21st November 2009, 09:04
  3. How to make toolBar scrollable?
    By hasmik in forum Qt Programming
    Replies: 5
    Last Post: 7th July 2009, 11:24
  4. QStackedWidget scrollable
    By mattia in forum Qt Tools
    Replies: 1
    Last Post: 19th April 2008, 09:02
  5. Fast painting scrollable widget
    By bunjee in forum Qt Programming
    Replies: 20
    Last Post: 24th October 2007, 19:47

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.