On Wed, May 12, 2010 at 1:04 AM, Mark Summerfield <[email protected]> wrote: > 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?
I just tried with this: tm = MyTableModel(data) tv.setSortingEnabled(False) proxy.setSourceModel(tm) tv.setSortingEnabled(True) But it made no performance difference. -- Steve Borho _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
