qt5base-lts/tests/auto/corelib/itemmodels
Giuseppe D'Angelo bec1854cc0 QSortFilterProxyModel: keep the sorting on unrelated changes
Whenever the source model of a QSortFilterProxyModel changes, and
the changes involve the sorted column, the implementation removes
the changed rows from the mapping, sorts them, and inserts them back;
in case of identical items, the rows are inserted at the end of the
block of equal rows.

The problem is that if the change doesn't actually happen on the roles
that are used for sorting, then we shuffle the rows, terribly confusing
the user. The typical case is a model with identical checkable rows:
(un)checking one row will move it at the end.

So, instead of trying to be smart with the removal/sort/insert sorted,
simply resort everything under the changed parent index. Since the
sorting used is stable, this keeps the items in the same positions.

Task-number: QTBUG-1548
Change-Id: Id0e61bd49da53b0a3e8aefa6b6893ac41179dc6f
Reviewed-by: David Faure <david.faure@kdab.com>
2014-11-20 14:58:26 +01:00
..
qabstractitemmodel Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qabstractproxymodel Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qidentityproxymodel Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qitemmodel Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qitemselectionmodel Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qsortfilterproxymodel QSortFilterProxyModel: keep the sorting on unrelated changes 2014-11-20 14:58:26 +01:00
qstringlistmodel Update license headers and add new license files 2014-09-24 12:26:19 +02:00
itemmodels.pro exclude gui-needing tests from -no-gui build 2013-10-18 20:05:27 +02:00