PDA

View Full Version : How to fasten QSortFilterProxyModel ?



Guilo
24th April 2010, 17:24
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

wysota
24th April 2010, 22:19
How does your filter look like?

Guilo
25th April 2010, 12:20
mod->setFilterRegExp(QRegExp(filt, Qt::CaseInsensitive,QRegExp::FixedString));
mod->setFilterKeyColumn(0);
where mod is my QSortFilterProxyModel

Guilo
25th April 2010, 13:34
It's ok. QListView::setUniformItemSizes(true) makes it a LOT faster