Results 1 to 9 of 9

Thread: QList < QHash < int, QString> > ... clear() is slow

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QList < QHash < int, QString> > ... clear() is slow

    I'm translating an old application into qt...
    I started doing a QList < QString > as it was the original algorithm, but this was meaning looking into the string everytime I needed a value.

    I now translated the <QString> into a QHash <int, QString>, witch applies perfectly to my purpose...

    BUT NOW...

    When I do QList::clear() ... this turn into an extremely slow operation, 3x more slow then keeping my old algorithm.

    What can I do to improve performances of clear() ??? Does it dependes on QList or on QHash???

    Do I have to turn into a QSqlTableModel??? But this would mean to break all old algorithms and the Boss wouldn't be happy
    Last edited by JoZCaVaLLo; 14th March 2011 at 16:08.

Similar Threads

  1. Sort a QHash<QString, int> by value
    By Trader in forum Qt Programming
    Replies: 7
    Last Post: 7th July 2010, 19:03
  2. how can i destruct QHash<QString, QPixmap>?
    By SamSong in forum Qt Programming
    Replies: 1
    Last Post: 7th February 2010, 06:41
  3. How does QString::qHash() work?
    By Morea in forum Qt Programming
    Replies: 4
    Last Post: 7th September 2009, 09:17
  4. Fastest way to clear a QList
    By steg90 in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 09:26
  5. Query about QHash , QList
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 14th December 2006, 09:04

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.