diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2011-11-10 13:24:33 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-11 12:24:48 +0100 |
commit | 0b293e4afc3a9d25336e862509a46ad024dccf04 (patch) | |
tree | eaca788d85f920d4b77dfd94e3cc55c95e15d054 /tests/auto/widgets | |
parent | af914694d81317b4a7bf0804d9d34a1f3bf2cf48 (diff) |
Make this API virtual to make selection proxying possible.
Change-Id: Ie93c8b38c59d347026a68eae03687d9017b3d048
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp index f7ce339854..19386d342c 100644 --- a/tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -2675,6 +2675,12 @@ public: using QItemSelectionModel::select; + void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) + { + QItemSelectionModel::setCurrentIndex(index, command); + m_target->setCurrentIndex(index, command); + } + private: QItemSelectionModel *m_target; @@ -2708,6 +2714,9 @@ void tst_QItemSelectionModel::testChainedSelectionClear() QVERIFY(selectedIndexes.size() == 0); } + duplicate.setCurrentIndex(model.index(0, 0), QItemSelectionModel::NoUpdate); + + QVERIFY(selectionModel.currentIndex() == duplicate.currentIndex()); } QTEST_MAIN(tst_QItemSelectionModel) |