summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels/qabstractitemmodel.cpp
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-01-24 16:48:22 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-24 19:12:23 +0100
commit9af77d214a3e01bf1ce34384f84ac1c08e6be2fe (patch)
tree4b9f31961baefbebc1fb0729496a01376b10e3d7 /src/corelib/itemmodels/qabstractitemmodel.cpp
parent764840ec0e189b4a9f76cdd659d82a2a50324190 (diff)
Deprecate QAbstractItemModel::reset().
It is broken in most uses because it emits modelAboutToBeReset() after actually resetting the internal data instead of before. That is, usually it is used like this: myData.clear(); reset(); Which should be beginResetModel(); myData.clear(); endResetModel(); Change-Id: I7b00a1e40c4915930944340764074efc29faaf5a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/itemmodels/qabstractitemmodel.cpp')
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 50a63e28da..a6446b2bb5 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2927,19 +2927,14 @@ void QAbstractItemModel::endMoveColumns()
}
/*!
+ \obsolete
+
Resets the model to its original state in any attached views.
\note Use beginResetModel() and endResetModel() instead whenever possible.
Use this method only if there is no way to call beginResetModel() before invalidating the model.
Otherwise it could lead to unexpected behaviour, especially when used with proxy models.
*/
-void QAbstractItemModel::reset()
-{
- Q_D(QAbstractItemModel);
- emit modelAboutToBeReset();
- d->invalidatePersistentIndexes();
- emit modelReset();
-}
/*!
Begins a model reset operation.