From a42a1db6e1deade3ce9bdd1efaef1077dd0f2aeb Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 20 Dec 2012 13:20:29 +0100 Subject: [PATCH] QAbstractProxyModel: Document setSourceModel a bit more Especially so that subclasses remember to emit reset. Change-Id: Iadcae3fc5fe72584465d4134f385ed0a1d77bfcd Reviewed-by: Stephen Kelly --- src/corelib/itemmodels/qabstractproxymodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp index 715a186b97..0175a0f2fa 100644 --- a/src/corelib/itemmodels/qabstractproxymodel.cpp +++ b/src/corelib/itemmodels/qabstractproxymodel.cpp @@ -124,6 +124,10 @@ QAbstractProxyModel::~QAbstractProxyModel() /*! Sets the given \a sourceModel to be processed by the proxy model. + + Subclasses should call beginResetModel() at the beginning of the method, + disconnect from the old model, call this method, connect to the new model, + and call endResetModel(). */ void QAbstractProxyModel::setSourceModel(QAbstractItemModel *sourceModel) {