diff options
author | Leonardo Sobral Cunha <leo.cunha@nokia.com> | 2009-07-28 13:55:28 (GMT) |
---|---|---|
committer | Leonardo Sobral Cunha <leo.cunha@nokia.com> | 2009-08-04 08:27:55 (GMT) |
commit | 549736341a2268e33159949e076e0629abeb838a (patch) | |
tree | 46be1157e6dc66c610a9d1d91351fc89aa0e8023 | |
parent | d3c96863ec17a69c616bdcb12e6a99a874eba66d (diff) | |
download | Qt-549736341a2268e33159949e076e0629abeb838a.zip Qt-549736341a2268e33159949e076e0629abeb838a.tar.gz Qt-549736341a2268e33159949e076e0629abeb838a.tar.bz2 |
Fixes selectionModel::hasSelection return value after model::reset
After resetting the model, the selectionModel::hasSelection()
of the view should return false.
Fixed the corresponding autotest, which was wrong.
Task-number: 256502
Reviewed-by: thierry
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp | 2 |
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); |