Results 1 to 7 of 7

Thread: How to iterate through QListWidget items

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How to iterate through QListWidget items

    I need to loop through QListWidget items to save each one of them in a .txt file

    i have no problems with file manipulation all that i need is a way to loop through the list items.

  2. #2
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: How to iterate through QListWidget items

    Try this.....

    Qt Code:
    1. for(int row = 0; row < listWidget->count(); row++)
    2. {
    3. QListWidgetItem *item = listWidget->item(row);
    4. // process item
    5. .......
    6. }
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to saa7_go for this useful post:

    zero-n (26th July 2010)

  4. #3
    Join Date
    Jul 2010
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to iterate through QListWidget items

    Thanks that works for me

Similar Threads

  1. Move items up and down in QListWidget
    By araglin in forum Newbie
    Replies: 7
    Last Post: 31st August 2016, 11:05
  2. Iterate the QListWidget
    By vishal.chauhan in forum Newbie
    Replies: 1
    Last Post: 26th February 2007, 07:51
  3. Get Visible Items from the QListWidget
    By srj in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 20:13
  4. Iterate and get Checked QTable items??
    By darpan in forum Newbie
    Replies: 2
    Last Post: 10th May 2006, 18:27
  5. Getting all items of a QListWidget
    By Codepoet in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2006, 22:52

Tags for this Thread

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.