View Full Version : ListWidget horizontal scroll.

17th July 2007, 01:34
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.


17th July 2007, 06:48
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.

17th July 2007, 06:54
use setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded );

17th July 2007, 07:32
Problem solved by setting setWrapping(false)