Results 1 to 6 of 6

Thread: QListWidget and QListWidgetItem

  1. #1
    Join Date
    Feb 2009
    Posts
    53
    Thanks
    5

    Default QListWidget and QListWidgetItem

    Hi I have QListWidget and I want to set QListWidgetItem in 2 columns. Can someone help me, how I set it? thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QListWidget and QListWidgetItem

    don't get you right:
    - if you mean that you want to add the same item twice see the documentation:
    Warning: A QListWidgetItem can only be added to a QListWidget once. Adding the same QListWidgetItem multiple times to a QListWidget will result in undefined behavior.
    - if you really want two columns you should use QTableWidget.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidget and QListWidgetItem

    QListWidget has only one column. why don't you use QTableWidget insted of QListWidget or use your own model with own view?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. #4
    Join Date
    Feb 2009
    Posts
    53
    Thanks
    5

    Default Re: QListWidget and QListWidgetItem

    Quote Originally Posted by Lykurg View Post
    this is what I find thx

  5. #5
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QListWidget and QListWidgetItem

    QTreeWidget can also have multiple columns. I prefer it over QTableWidget because there is less vertical space wasted between the entries.

  6. #6
    Join Date
    Jun 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidget and QListWidgetItem

    I want to use QListWidget in two or more columns. why not use QTreeWidget or QTableWidget,because they have no IconMode. how should I do? my email : yunxiaodong@163.com
    Last edited by yunxiaodong; 3rd August 2011 at 10:14. Reason: updated contents

Similar Threads

  1. Replies: 3
    Last Post: 25th July 2008, 14:30
  2. Check Box problem
    By Seema Rao in forum Qt Programming
    Replies: 6
    Last Post: 30th November 2007, 19:32
  3. Showing Pixmap as a QListWidget Item
    By vishal.chauhan in forum Qt Programming
    Replies: 1
    Last Post: 1st February 2007, 12:25
  4. keypress while editing an item in QListWidget
    By Beluvius in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2006, 09:56
  5. QListWidget add QListWidgetItem
    By fellobo in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2006, 19:37

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.