Results 1 to 2 of 2

Thread: filling scrollview

  1. #1
    Join Date
    Feb 2006
    Posts
    29
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Windows

    Default filling scrollview

    hi all,

    does anyone know how to fill a scrollview with its contents when its contents are smaller than the viewport?

    i've got 5 widgets laid out horizontally. when the viewport is short there's a scrollbar, great. however, when the viewport is taller than the widgets, there's just a gray space taking up the extra room instead of resizing the widgets. i tried various combinations of layouts as children of the viewport and scrollview, but nothing expands my widgets.

    any ideas?
    thanks!
    lou

  2. #2
    Join Date
    Feb 2006
    Posts
    29
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: filling scrollview

    well, i don't like creating extra widgets if i don't have to, but i solved this problem by creating one frame that contains my 5 widgets. then i added a layout to the frame.

    for the scrollview, i did
    Qt Code:
    1. setResizePolicy (QScrollView::AutoOneFit);
    To copy to clipboard, switch view to plain text mode 
    which works great with one child. it doesn't work if there's more than one child widget of the scrollview, but putting them all in a frame means now there is only one direct child (with lots of grandchildren).

    just fyi.

    lou

Similar Threads

  1. implementing 'scrollview'
    By rishiraj in forum Newbie
    Replies: 1
    Last Post: 18th December 2008, 13:23
  2. Filling forms with QWebKit
    By physicistjedi in forum Qt Programming
    Replies: 1
    Last Post: 4th December 2008, 19:50
  3. Filling an ellipse with a QRadialGradient brush
    By Caius Aérobus in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2008, 07:16
  4. Filling very small polygons.
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 5th March 2008, 16:19

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.