From 0b293e4afc3a9d25336e862509a46ad024dccf04 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 10 Nov 2011 13:24:33 +0100 Subject: Make this API virtual to make selection proxying possible. Change-Id: Ie93c8b38c59d347026a68eae03687d9017b3d048 Reviewed-by: Olivier Goffart --- .../itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/widgets') 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) -- cgit v1.2.3