summaryrefslogtreecommitdiff
path: root/src/corelib/itemmodels/qabstractitemmodel.h
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.h
parent764840ec0e189b4a9f76cdd659d82a2a50324190 (diff)
downloadqtbase-9af77d214a3e01bf1ce34384f84ac1c08e6be2fe.tar.gz
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.h')
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index e5e6d26e93..36de591b8a 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -306,7 +306,14 @@ protected:
bool beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn);
void endMoveColumns();
- void reset();
+
+#if QT_DEPRECATED_SINCE(5,0)
+ QT_DEPRECATED void reset()
+ {
+ beginResetModel();
+ endResetModel();
+ }
+#endif
void beginResetModel();
void endResetModel();