qt5base-lts/tests/auto/corelib/itemmodels
Jan Kundrát 267ba8b63e QAbstractProxyModel::sibling: treat row/column as offsets within the proxy
Qt5 allows QAIM subclasses to reimplement the sibling() method. Unfortunately,
the default QAbstractProxyModel's reimplementation differs in behavior to what
the Qt4 version was doing. In particular, the Qt4 version used to use the row
and column as positions within the proxy model, while the Qt5 version mistakenly
does this at the level of source model. This is arguably broken; the caller asks
for a sibling of the proxy index, not for a sibling within the proxy model.

This change makes the QAPM::sibling work explicitly in the same way as the Qt4
code behaved.

The reimplementation of QAbstractProxyModel::sibling was introduced in
9dfba89c28. It was subsequently fixed with commit
999109866d not to return indexes from the source
model, but the logic was still different from the Qt4 version.

[ChangeLog][QtCore][QAbstractProxyModel] Fixed QAbstractProxyModel::sibling to
work in the same manner as the Qt4 code used to behave. Previously, Qt5's
implementation would treat the row and column as positions in the source model
instead of a position in the proxy itself.

Followup-to 9dfba89c28 and
999109866d
Change-Id: Ia25027b2ad9e4777ba28de2d2226d48f8cccf587
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-05-29 11:11:02 +02:00
..
qabstractitemmodel don't erroneously claim that gui support is needed 2013-10-16 17:10:15 +02:00
qabstractproxymodel QAbstractProxyModel::sibling: treat row/column as offsets within the proxy 2014-05-29 11:11:02 +02:00
qidentityproxymodel Don't bypass overwritten [set]data() methods in the proxy. 2013-04-08 14:17:27 +02:00
qitemmodel Fix minor typos in docs, printed messages & comments 2013-01-28 18:12:41 +01:00
qitemselectionmodel Remove qSort usages from core tests 2014-02-22 09:51:14 +01:00
qsortfilterproxymodel tests: Remove superfluous gui additions to QT 2014-02-28 17:59:29 +01:00
qstringlistmodel Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
itemmodels.pro exclude gui-needing tests from -no-gui build 2013-10-18 20:05:27 +02:00