diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2013-01-28 19:17:21 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-30 10:44:32 +0100 |
commit | 8eae3a923a540f3dbfe9445a1d58c59f20294684 (patch) | |
tree | a93dad0a54077d5f35a040f5c580a0987d05d837 /src/corelib/itemmodels/qabstractitemmodel.cpp | |
parent | b28d56588a93852a8c7034a3b8b3c9146d1d8b28 (diff) |
Provide the resetInternalData slot to cleanly reset data in proxy subclasses.
This was part of Qt 4.8, but Qt 5.0 was branched before that, so
the commit was lost.
Change-Id: I2a2ab3c75a0943ac734d588ebd74bc158dd6aaaf
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/itemmodels/qabstractitemmodel.cpp')
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 2a2d376a26..90e9886c90 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -866,6 +866,27 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, } /*! + \since 4.8 + + This slot is called just after the internal data of a model is cleared + while it is being reset. + + This slot is provided the convenience of subclasses of concrete proxy + models, such as subclasses of QSortFilterProxyModel which maintain extra + data. + + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 12 + + \note Due to a mistake, this slot is missing in Qt 5.0. + + \sa modelAboutToBeReset(), modelReset() +*/ +void QAbstractItemModel::resetInternalData() +{ + +} + +/*! \class QModelIndex \inmodule QtCore @@ -3055,6 +3076,7 @@ void QAbstractItemModel::endResetModel() { Q_D(QAbstractItemModel); d->invalidatePersistentIndexes(); + QMetaObject::invokeMethod(this, "resetInternalData"); emit modelReset(QPrivateSignal()); } |