Results 1 to 4 of 4

Thread: using QStringList as QList<QListWidgetItem*>

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: using QStringList as QList<QListWidgetItem*>

    It seems that you do some simple things very complicated... But anyway:
    Qt Code:
    1. QStringList removes;
    2. QList<QListWidgetItem*> tmpList = this->ui->ListPic->selectedItems();
    3. for (int i = 0; i < tmpList.size(); ++i)
    4. removes.append(tmpList.at(i)->text());
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Lykurg for this useful post:

    geleven (8th April 2010)

  3. #2
    Join Date
    Apr 2010
    Posts
    7
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: using QStringList as QList<QListWidgetItem*>

    Quote Originally Posted by Lykurg View Post
    It seems that you do some simple things very complicated... But anyway:
    Qt Code:
    1. QStringList removes;
    2. QList<QListWidgetItem*> tmpList = this->ui->ListPic->selectedItems();
    3. for (int i = 0; i < tmpList.size(); ++i)
    4. removes.append(tmpList.at(i)->text());
    To copy to clipboard, switch view to plain text mode 
    woah... it's that simple.. it seems i thinking too far away.. thanks for the help

Similar Threads

  1. QStringList or QList , which is faster
    By BalaQT in forum Newbie
    Replies: 3
    Last Post: 3rd April 2010, 08:48
  2. QList/QStringList comparison question
    By di_zou in forum Newbie
    Replies: 5
    Last Post: 28th October 2009, 14:35
  3. replace string in QList<QStringList>
    By estanisgeyer in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2008, 17:40
  4. Casting QStringList to QList<QVariant>
    By Valheru in forum Newbie
    Replies: 3
    Last Post: 5th October 2006, 22:24
  5. Replies: 7
    Last Post: 2nd June 2006, 12:48

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.