Results 1 to 4 of 4

Thread: Scrolling widgets

  1. #1
    Join Date
    Dec 2010
    Posts
    55
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Scrolling widgets

    I have a rectangular area at the bottom of my application. I would like to horizontally add a list of "tiles" (vertically a QLabel and a QGraphicsView). As I add tiles (problematically) I'd like a horizontal scrollbar to appear. The aspect ratio needs to be fixed. They can resize larger if the height grows.

    I setup a QGridLayout then in my software I simply do "layout->addWidget(....)" adding to the correct rows and columns.

    However this just squeezes everything into the view instead of adding a scrollbar and the aspect ratio is maintained.

    Is there a scrolling layout I can use?
    Running:
    RHEL 5.4
    Python 2.7.2
    Qt 4.7.4
    SIP 4.7.8
    PyQt 4.7

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Scrolling widgets

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2010
    Posts
    55
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: Scrolling widgets

    I tried to use a qscrollarea
    However, I still have a layout in the scroll area which wants to take up 100% of the space.
    therefore nothing scrolls, everything just gets squeezed in.

    I'd like the aspect ratio of each tile to be maintained and the size to be constrained by the height of the scroll area.
    Running:
    RHEL 5.4
    Python 2.7.2
    Qt 4.7.4
    SIP 4.7.8
    PyQt 4.7

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Scrolling widgets

    Set "widgetResizable" property to true. As for resizing, use height-for-width mechanism or do the resizing yourself.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 30th April 2012, 16:17
  2. Replies: 2
    Last Post: 30th March 2011, 21:20
  3. Replies: 5
    Last Post: 19th April 2010, 00:31
  4. Replies: 0
    Last Post: 15th May 2009, 16:38
  5. Scrolling between two widgets
    By vfernandez in forum Newbie
    Replies: 1
    Last Post: 30th October 2006, 16:39

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
  •  
Qt is a trademark of The Qt Company.