Results 1 to 2 of 2

Thread: Iterate the QListWidget

  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Iterate the QListWidget

    Hi All,


    I m using Qt 4.2.2 on my Intel Mac.

    I have a ListWidget and some Items in that.
    I want to Itearte this listWidget that is I want each item of QListWidget satisfy a perticular condition so I need each Item of List Widget .


    If any one knows then plz help me.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Iterate the QListWidget

    Either use QListWidget::findItems() or:

    Qt Code:
    1. for(int i=0;i<list->count;i++){
    2. QListWidgetItem *item = list->item(i);
    3. doSomething(item);
    4. }
    To copy to clipboard, switch view to plain text mode 

  3. The following 3 users say thank you to wysota for this useful post:

    the_bis (24th July 2007), tpf80 (17th May 2007), vishal.chauhan (26th February 2007)

Similar Threads

  1. Replies: 13
    Last Post: 15th December 2006, 11:52
  2. QTableWidget or QListWidget
    By bpetty in forum Newbie
    Replies: 3
    Last Post: 6th December 2006, 19:40
  3. QListWidget help please
    By munna in forum Qt Programming
    Replies: 5
    Last Post: 28th November 2006, 12:16
  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.