Results 1 to 3 of 3

Thread: Fastest way to clear a QList

  1. #1
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Fastest way to clear a QList

    Hi,

    I'm doing the following to remove items from my QList :

    Qt Code:
    1. for( int i = 0; i < m_Data.count(); i++ )
    2. m_Data.removeAt( i );
    To copy to clipboard, switch view to plain text mode 

    QList is defined as QList<QString>

    Is there a quicker way as sometimes there can be over 500,000 QString's in the list.

    Regards,
    Steve

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Fastest way to clear a QList

    J-P Nurmi

  3. #3
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Fastest way to clear a QList

    Lol

    Thanks,
    Steve

Similar Threads

  1. Accessing QList Objects
    By magikalpnoi in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2006, 20:43

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.