- 
    
Bug
 - 
    Resolution: Done
 - 
    
P3: Somewhat important
 - 
    4.7.1
 - 
    None
 
- 
        d18eb260d70b75376411fe3f69da82bf46fb503f
 
The model is not efficient for large amount of data, especially when you want to sort all but a few items. The sort itself is not the problem. The problem comes from the fucntion indexesFromRange that goes through all the indexes:
static void indexesFromRange(const QItemSelectionRange &range, QModelIndexList &result) in qitemselectionmodel.cpp
Test case - to reproduce:
- select the entire table (click in top left)
 - then, deselect a couple of rows using ctrl-click
 - then, click the column 2 header to trigger a sort
 
Also while it would help, reimplementing QItemSelectionModel is not a solution here as the virtual functions exposed are limited.
| For Gerrit Dashboard: QTBUG-17732 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 35777,1 | Don't call parent() so often when processing a range. | master | qt/qtbase | Status: MERGED | +2 | 0 | 
| 35778,4 | Use the sibling method to make iteration over a range potentially faster. | master | qt/qtbase | Status: MERGED | +2 | 0 | 
| 35830,6 | Use the layout change hint to speed up QItemSelectionModel. | master | qt/qtbase | Status: MERGED | +2 | 0 |