Hi All,
I have a QSortFilterProxyModel connected to a QAbstractItemModel that implements a tree.
I need to move ~8000 rows around which should be fine.
However, for each one of those moves (done with individual pairs of beginMoveRows / endMoveRows) the QSortFilterProxyModel clears all the internal index mappings and then tries to update all persistent indexes right after (that's all in QSortFilterProxyModelPrivate::_q_sourceLayoutChang ed). The problem is that updating the persistent indexes re-creates the mappings again and forces everything to sort, even when dynamic sorting is disabled (this is done in QSortFilterProxyModelPrivate::create_mapping). This is done for each row that is moved, and since I am using QStrings sorting is VERY slow.
I'm considering storing my data already sorted so I avoid all the string comparisons, but before I go that route I wanted to ask. Does the QSortFilterProxyModel need to do all this creating/destroying/sorting of the mappings, is there a way to avoid it? Am I using this wrong?
Thanks a lot!
Bookmarks