diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-09-26 18:16:08 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-02 16:25:02 +0100 |
commit | 9dfba89c28bbff3316cb7aed6c07f90c0f2d5a22 (patch) | |
tree | 1a9643ef367a24f836ec0a552229106b3776b7dd /tests/auto/other | |
parent | 000025ca1ecabe363934bdc8794b01ffb926af66 (diff) |
Add implementations of QAIM::sibling in public APIs.
Change-Id: I2248641f2ed8735c28bd9572470520995a4a5b62
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/auto/other')
-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 ); |