Results 1 to 4 of 4

Thread: QListWidget add QListWidgetItem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QListWidget add QListWidgetItem

    My code seems right but doesn't display anything in my QListWidget. So, what am I doing wrong? Thanks for the help
    Qt Code:
    1. QListWidgetItem add1("item 1", 0, 1);
    2. QListWidgetItem add2("item 2", 0, 2);
    3. QListWidgetItem add3("item 3", 0, 3);
    4. QListWidgetItem add4("item 4", 0, 4);
    5. list_widget->addItem(&add1);
    6. list_widget->addItem(&add2);
    7. list_widget->addItem(&add3);
    8. list_widget->addItem(&add4);
    To copy to clipboard, switch view to plain text mode 

    What I think should happen is this: I would have a QListWidget (made from a form) that shows item 1 to item 4... I am trying to use the type as an ID so that if item 1 is a different language then I have the ID not the string.

    What happens is I don't see anything in my QListWidget (it is empty right after adding them all.) I am using QT 4.0
    Last edited by fellobo; 20th February 2006 at 18:51. Reason: code part looked wrong

Similar Threads

  1. QListWidget and QListWidgetItem
    By Noxxik in forum Qt Programming
    Replies: 5
    Last Post: 3rd August 2011, 09:59
  2. Replies: 3
    Last Post: 25th July 2008, 14:30
  3. Check Box problem
    By Seema Rao in forum Qt Programming
    Replies: 6
    Last Post: 30th November 2007, 19:32
  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.