Results 1 to 2 of 2

Thread: QListWidget in iconMode with only 1 row

  1. #1
    Join Date
    Sep 2009
    Location
    Aachen, Germany
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QListWidget in iconMode with only 1 row

    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?
    Attached Images Attached Images
    • File Type: jpg 1.jpg (41.7 KB, 59 views)
    • File Type: jpg 2.jpg (39.2 KB, 43 views)

  2. #2
    Join Date
    Jan 2008
    Location
    Forstinning, Germany
    Posts
    10
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidget in iconMode with only 1 row

    It's really simple.

    Qt Code:
    1. listView.setWrapping(false);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. getting QString out of QListWidget
    By tommy in forum Qt Programming
    Replies: 7
    Last Post: 3rd August 2009, 13:10
  2. QListWidget transparent background or pixmap
    By wdezell in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2009, 17:53
  3. QListWidget Problem
    By pmabie in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2007, 06:52
  4. Replies: 13
    Last Post: 15th December 2006, 11:52
  5. keypress while editing an item in QListWidget
    By Beluvius in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2006, 09:56

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.