Results 1 to 3 of 3

Thread: QSortFilterProxyModel invalidateFilter() vs. reset()

  1. #1
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QSortFilterProxyModel invalidateFilter() vs. reset()

    Hello *,

    I have a subclass of a QSortFilterProxyModel which I use for filtering of a large amount of data (~ 200.000 entries). Every time the filter routine has finished I used to call reset() so that the view would reload the data. I used reset() instead of invalidateFilter() because the documentation explicitly suggests that:

    Quote Originally Posted by From the Qt 4.7 documentation
    If you are working with large amounts of filtering and have to invoke invalidateFilter() repeatedly, using reset() may be more efficient, depending on the implementation of your model. However, reset() returns the proxy model to its original state, losing selection information, and will cause the proxy model to be repopulated.
    However, since I upgraded to Qt 4.7 this approach doesn't work anymore. The view does not request any data after the model-reset has been performed. invalidateFilter() works for me, but is very slow in comparison with the version that uses reset(). I found out that invalidate() does the job and is considerably faster than invalidateFilter(). Does anybody have a clue why reset() is not working anymore?

  2. #2
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSortFilterProxyModel invalidateFilter() vs. reset()

    I noticed this, too. reset() doesn't seem to work anymore to invalidate the filter settings in QSortFilterProxyModel since QT 4.7.

  3. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Thanks
    11
    Thanked 16 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSortFilterProxyModel invalidateFilter() vs. reset()

    just an idea: how is the performance if you reset() the source model?

Similar Threads

  1. Replies: 1
    Last Post: 9th February 2010, 13:11
  2. QSortFilterProxyModel.invalidateFilter() misunderstanding
    By aspidites in forum Qt Programming
    Replies: 2
    Last Post: 23rd April 2009, 14:17
  3. Bug in Qt4.3.3 QXmlSimpleReader::reset() ?
    By Shawn in forum Qt Programming
    Replies: 9
    Last Post: 3rd March 2008, 10:14
  4. reset QwtPlot
    By sarefo in forum Qwt
    Replies: 1
    Last Post: 24th January 2008, 09:00
  5. QImage reset
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2007, 11:18

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.