PDA

View Full Version : QListWidget in iconMode with only 1 row



ChiliPalmer
18th December 2009, 23:27
Hi,

I'm building a little picture-viewer for a project. All it is supposed to do is show thumbnails of certain pictures in only one row.

I wanted to use a QListWidget in iconMode to display the thumbnails, so I don't have to implement too many methods (drag and drop etc.).
The problem is, as soon as I try to add more pictures than the widget's current width can show (i.e., make a scrollbar neccessary), the ListWidget arranges the items in multiple rows with as many columns as a row can show.

I've attached two screenshots. The first shows what I want it to do, the second what it actually does.

Is there any way to limit a QListWidget to only one row, or do I have to build that myself?

hwerglmir
20th December 2009, 08:18
It's really simple.



listView.setWrapping(false);