diff options
Diffstat (limited to 'tests/auto/other/modeltest/modeltest.cpp')
-rw-r--r-- | tests/auto/other/modeltest/modeltest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp index f8338dc6fa..17f164b638 100644 --- a/tests/auto/other/modeltest/modeltest.cpp +++ b/tests/auto/other/modeltest/modeltest.cpp @@ -339,6 +339,8 @@ void ModelTest::checkChildren ( const QModelIndex &parent, int currentDepth ) //qDebug() << "parent:" << model->data(parent).toString() << "rows:" << rows // << "columns:" << columns << "parent column:" << parent.column(); + const QModelIndex topLeftChild = model->index( 0, 0, parent ); + QVERIFY( !model->hasIndex ( rows + 1, 0, parent ) ); for ( int r = 0; r < rows; ++r ) { if ( model->canFetchMore ( parent ) ) { @@ -362,6 +364,15 @@ void ModelTest::checkChildren ( const QModelIndex &parent, int currentDepth ) QModelIndex b = model->index ( r, c, parent ); QVERIFY( a == b ); + { + const QModelIndex sibling = model->sibling( r, c, topLeftChild ); + QVERIFY( index == sibling ); + } + { + const QModelIndex sibling = topLeftChild.sibling( r, c ); + QVERIFY( index == sibling ); + } + // Some basic checking on the index that is returned QVERIFY( index.model() == model ); QCOMPARE( index.row(), r ); |