Results 1 to 4 of 4

Thread: How to fasten QSortFilterProxyModel ?

  1. #1
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default How to fasten QSortFilterProxyModel ?

    Hi !

    I am using a QListView and a QLineEdit which filters the QLIstView model with a QSortFilterProxyModel. My model is filled with 8000 rows, one column. But it is quite slow to filter. How to fasten this ? For example in QtCreator when you search for help the filtering is instantaneous whereas there are probably more than 8000 rows.

    Thanks
    Last edited by Guilo; 24th April 2010 at 21:57.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to fasten QSortFilterProxyModel ?

    How does your filter look like?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to fasten QSortFilterProxyModel ?

    Qt Code:
    1. mod->setFilterRegExp(QRegExp(filt, Qt::CaseInsensitive,QRegExp::FixedString));
    2. mod->setFilterKeyColumn(0);
    To copy to clipboard, switch view to plain text mode 
    where mod is my QSortFilterProxyModel

  4. #4
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to fasten QSortFilterProxyModel ?

    It's ok. QListView::setUniformItemSizes(true) makes it a LOT faster

Similar Threads

  1. Problem QSortFilterProxyModel
    By estanisgeyer in forum Qt Programming
    Replies: 3
    Last Post: 15th June 2009, 18:51
  2. QSortFilterProxyModel with QComboBox
    By h123 in forum Qt Programming
    Replies: 1
    Last Post: 10th June 2009, 19:16
  3. Using QSortFilterProxyModel
    By Jennie Bystrom in forum Qt Programming
    Replies: 3
    Last Post: 6th December 2007, 10:28
  4. QSortFilterProxyModel - filterKeyColumn
    By SirBabyface in forum Qt Programming
    Replies: 1
    Last Post: 7th September 2007, 16:09
  5. QSortFilterProxyModel
    By evgenM in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2007, 11:53

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.