From 45e5a6ff7c6165aa8dfa0cb4f0e8f54cbef45f6e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 12 Aug 2013 16:19:20 +0200 Subject: [PATCH] Reset the QItemSelectionModel when its model is reset. Change-Id: I12af41adb18a2ecf8825b23d5715766dcae55436 Reviewed-by: Olivier Goffart --- src/corelib/itemmodels/qitemselectionmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index a4d73ea480..ea4d9b44c3 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -622,6 +622,8 @@ void QItemSelectionModelPrivate::initModel(QAbstractItemModel *model) q, SLOT(_q_layoutAboutToBeChanged(QList,QAbstractItemModel::LayoutChangeHint))); QObject::connect(model, SIGNAL(layoutChanged(QList,QAbstractItemModel::LayoutChangeHint)), q, SLOT(_q_layoutChanged(QList,QAbstractItemModel::LayoutChangeHint))); + QObject::connect(model, SIGNAL(modelReset()), + q, SLOT(reset())); } }