From 6acdb3256113a5cdc9633077ada5674e5ee694d1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 16 Jan 2012 14:51:29 +0100 Subject: Clarify docs that everything must be re-queried on model reset. Change-Id: I05970302d4f52d092a7c65a45b9e5a3570b1d144 Reviewed-by: Olivier Goffart --- src/corelib/itemmodels/qabstractitemmodel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index dec1fe4cef..a2776271a8 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -2141,9 +2141,7 @@ QSize QAbstractItemModel::span(const QModelIndex &) const Sets the model's role names to \a roleNames. This function allows mapping of role identifiers to role property names in - Declarative UI. This function must be called before the model is used. - Modifying the role names after the model has been set may result in - undefined behaviour. + scripting languages. \sa roleNames() */ @@ -3420,6 +3418,11 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti This signal is emitted when reset() is called, after the model's internal state (e.g. persistent model indexes) has been invalidated. + Note that if a model is reset it should be considered that all information + previously retrieved from it is invalid. This includes but is not limited + to the rowCount() and columnCount(), flags(), data retrieved through data(), + and roleNames(). + \sa endResetModel(), modelAboutToBeReset() */ -- cgit v1.2.3