qt5base-lts/tests/auto/corelib
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
..
animation Update license headers and add new license files 2014-09-24 12:26:19 +02:00
codecs Hardcode UTF-8 for "unicode" in QTextCodec::codecForHtml(). 2014-10-28 12:17:13 +01:00
global Remove trailing '\n' in qFormatLogMessage output 2014-10-27 08:59:02 +01:00
io Add Windows-specific notation for WebDAV to QUrl. 2014-11-17 21:47:29 +01:00
itemmodels QSortFilterProxyModel: keep the sorting on unrelated changes 2014-11-20 14:58:26 +01:00
json Update license headers and add new license files 2014-09-24 12:26:19 +02:00
kernel Add C++11 if available for QVariant autotest 2014-11-13 15:21:07 +01:00
mimetypes Update license headers and add new license files 2014-09-24 12:26:19 +02:00
plugin Update license headers and add new license files 2014-09-24 12:26:19 +02:00
statemachine tst_QState: fix memleaks 2014-10-19 13:18:12 +02:00
thread tst_QThreadPool: fix memleak 2014-10-19 13:18:07 +02:00
tools tst_QSharedPointer: fix memleak 2014-10-19 13:18:02 +02:00
xml Update license headers and add new license files 2014-09-24 12:26:19 +02:00
corelib.pro iOS: Enable building of basic tests 2014-01-22 12:35:17 +01:00