diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-30 09:52:42 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-30 09:52:42 (GMT) |
commit | 26e5da81695f633ef0d872a530d649ae3cc4cadb (patch) | |
tree | 103cd82ff7b9fcbe3412b3ece65d394d4dae7e39 /tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp | |
parent | 15d8672d0981f4ea8605e3c905f11a71286ff35b (diff) | |
parent | bdd34f907b919ea0742f28ba25b6a3c1ebe97e86 (diff) | |
download | Qt-26e5da81695f633ef0d872a530d649ae3cc4cadb.zip Qt-26e5da81695f633ef0d872a530d649ae3cc4cadb.tar.gz Qt-26e5da81695f633ef0d872a530d649ae3cc4cadb.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp')
-rw-r--r-- | tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp index 413419d..3736813 100644 --- a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -112,6 +112,8 @@ private slots: void testMoveWithinOwnRange_data(); void testMoveWithinOwnRange(); + void testMoveThroughProxy(); + void testReset(); @@ -1112,6 +1114,25 @@ void tst_QAbstractItemModel::testMoveSameParentUp() } } +void tst_QAbstractItemModel::testMoveThroughProxy() +{ + QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this); + proxy->setSourceModel(m_model); + + QList<QPersistentModelIndex> persistentList; + + persistentList.append(proxy->index(0, 0)); + persistentList.append(proxy->index(0, 0, proxy->mapFromSource(m_model->index(5, 0)))); + + ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this); + moveCommand->setNumCols(4); + moveCommand->setAncestorRowNumbers(QList<int>() << 5); + moveCommand->setStartRow(0); + moveCommand->setEndRow(0); + moveCommand->setDestRow(0); + moveCommand->doCommand(); +} + void tst_QAbstractItemModel::testMoveToGrandParent_data() { QTest::addColumn<int>("startRow"); |