Results 1 to 3 of 3

Thread: Qt list help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    1
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Qt list help

    heyy guys... i have a list of employee object (id , name , rate)... i want to convert it into a Qlist... so i can list those employees data into a listWidget ( addItems(cont QstringList &labels) ).... i really need some help here... i dnt have any idea of how to do this conversion....

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt list help

    You can not use a listwidget since it only contains a single column.
    Use a treewidget

    And use the examples and documentation.

  3. #3
    Join Date
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt list help

    Again, you must use a tree widget, as list widgets can only show one column.

    Anyway, just iterate over the objects with a loop, and add the rows in there. See the QTreeWidget documentation to find out how.

Similar Threads

  1. List View with sections for alphabetialy sorted list
    By woodtluk in forum Qt Programming
    Replies: 4
    Last Post: 12th October 2010, 11:50
  2. array list!
    By maider in forum Qt Programming
    Replies: 6
    Last Post: 27th July 2009, 16:27
  3. clearing a list.....
    By reshma in forum Qt Programming
    Replies: 7
    Last Post: 22nd March 2009, 15:28
  4. rss list
    By tyzhang3 in forum Qt Programming
    Replies: 1
    Last Post: 30th July 2008, 23:12
  5. list of list
    By quickNitin in forum Newbie
    Replies: 1
    Last Post: 3rd July 2006, 08:11

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
  •  
Qt is a trademark of The Qt Company.