Disconnect slots from the old sourcemodel in QIdentityProxyModel
authorkb <k.blammo@gmail.com>
Fri, 9 Mar 2012 11:29:09 +0000 (12:29 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 14 Mar 2012 10:37:18 +0000 (11:37 +0100)
commitfae4a2555a9402e8cecf67242b29dca624cc61e8
tree49c1129db8e4e2dd53b9d1a83b1259bb183b6704
parent62dfed9a7f2be68de2e12c6de370a3a68b1b3501
Disconnect slots from the old sourcemodel in QIdentityProxyModel

When setting a new sourcemodel QIdentityProxyModel::setSourceModel
tries to disconnect from signals belonging to the NEW model instead of
from the existing sourceModel(). QIdentityProxyModel thus receives
signals from both the old model(s) and the new model. This results in
ASSERTS triggering in various slots, for example:
"Q_ASSERT(topLeft.isValid() ? topLeft.model() == model : true);"
in QIdentityProxyModelPrivate::_q_sourceDataChanged.

Change-Id: Ic6f65a9ee10981d00206335f2edef78272fadc1a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/corelib/itemmodels/qidentityproxymodel.cpp