[PyQt] Performance problems with QSortFilterProxyModel

Mark Summerfield list at qtrac.plus.com
Wed May 12 07:04:11 BST 2010


On 2010-05-12, Steve Borho wrote:
> Hello,
> 
> The TortoiseHg project is currently porting all of our PyGTK apps to
> PyQt, This has been going pretty well so far, but I've hit a snag with
> our file status browser.
> 
> I have a simple QAbstractTableModel (4 columns) being displayed in a
> QTreeView.  After connecting a QSortFilterProxyModel between the tree
> view and the data model, reloading the model became very expensive for
> moderately sized data sets.  After calling setSourceModel() with a
> model of 555 rows, I counted over 3 million calls to the model data()
> method, which takes about 15 seconds.

Have you tried switching off sorting just before resetting the model and
then switching it back on afterwards?

[snip]


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Programming in Python 3 (Second Edition)" - ISBN 0321680561


More information about the PyQt mailing list