PDA

View Full Version : Speed up QTableView sorting



aguayro
21st December 2012, 02:38
I have a subclassed QAbstractTableModel, a QTableView and a QSortFilterProxyModel, using all together, all is ok but i'd lik to speed up te proxy sorting. If the table have 10,000 rows or more, it takes about 1 second to sort, it's not a lot of time i know, but, is there any way to make it instantly?
Like sublclassing QSortProxyModel or sort the QAbstractTableModel directly... it's possible to sort 15.000 rows instanty?
Thanks in advance

wysota
21st December 2012, 10:27
Sorting speed depends on the speed of the underlying model, especially its index() and data() implementation. So to speed up sorting you need to optimize your model.