qt5base-lts/tests/auto/corelib/itemmodels/qitemmodel
Andre Somers abbd26f553 Add QModelIndex::siblingAtColumn and ::siblingAtRow
Data in item models is most often organized in rows, where each column
contains an attribute of the item represented by the row. Often when
sibling is used, it is to request another piece of data from the same
row. Having a specialized version makes this easier and less awkward
to do, simplifying

auto sibling = index.sibling(index.row(), columnOfInterest);

to

auto sibling = index.siblingAtColumn(columnOfInterest);

For symmetry reasons, siblingAtRow(rowOfInterest) was also added.

Change-Id: Ib203b2cdb16154cbb2680d16fb5c6a7538f33d07
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-01-12 15:12:53 +00:00
..
.gitignore Move the qitemmodel test to the itemmodels directory. 2012-01-06 17:21:25 +01:00
modelstotest.cpp QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
qitemmodel.pro Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API. 2015-09-01 16:57:46 +00:00
README Move the qitemmodel test to the itemmodels directory. 2012-01-06 17:21:25 +01:00
tst_qitemmodel.cpp Add QModelIndex::siblingAtColumn and ::siblingAtRow 2018-01-12 15:12:53 +00:00

This is a QStandardItemModel test.  It will help catch a lot of simple problems.  You should still create your own test for custom functionality and functions that your model has.

Add your model to the modelstotest.cpp file (qt model's are included as examples) and modify the pro file accordingly.  Fix the errors in order of failure as later tests assume the ones before them have passed.