Results 1 to 4 of 4

Thread: ListWidget horizontal scroll.

  1. #1
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy ListWidget horizontal scroll.

    i using QT4.3 and i want to create a listWidget which able to scroll horizontally. All the item i set listview::iconmode.
    the problem: when the items in the listWidget more than the viewable size of listWidget, they automatically place vertically below of the first item. Which made it to be accessible only by vertical scroll.
    example: the ListWidget only allow to show 3 items, the 4th item will place below the 1st item and accessible by scroll vertically downward.

    the desire solution: When the items added more than the viewable size, all the item can only accessible by horizontal scroll only. Which mean it should not place vertically below but place horizontal direction.
    example: the ListWidget only allow to show 3 items, the 4th item should place beside the 3rd item and can accessible by scroll horizontally.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ListWidget horizontal scroll.

    Hi, it's really simple ;-)
    You have to set flow to Qt::LeftToRight, and set isWrapping to false !
    Those two properties are in the QListView section, at the bottom of property editor.

  3. #3
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Thanks
    7
    Thanked 25 Times in 24 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: ListWidget horizontal scroll.

    use setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded );

  4. #4
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ListWidget horizontal scroll.

    Problem solved by setting setWrapping(false)

Similar Threads

  1. QScrollArea's Scroll Bars
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 19th September 2006, 14:27

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.