summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp1
-rw-r--r--tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 8b6b5cb..94569ec 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -960,6 +960,7 @@ void QAbstractItemView::reset()
d->currentIndexSet = false;
setState(NoState);
setRootIndex(QModelIndex());
+ d->selectionModel->reset();
}
/*!
diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
index ae64e51..0541b46 100644
--- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -1547,7 +1547,7 @@ void tst_QItemSelectionModel::resetModel()
model.reset();
QVERIFY(view.selectionModel()->selection().isEmpty());
- QVERIFY(view.selectionModel()->hasSelection());
+ QVERIFY(view.selectionModel()->hasSelection() == false);
view.selectionModel()->select(QItemSelection(model.index(0, 0), model.index(5, 5)), QItemSelectionModel::Select);