diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-01 10:49:16 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-01 10:49:16 (GMT) |
commit | a3cd7065c5b630d9d949cc53db36f5c2d091c9fc (patch) | |
tree | fbf4f2d9b3e6bdbddf287771ef5f5a5e28cd3a3b /src/corelib | |
parent | fed237ecdd891df6ed4bd1e8e5f5b9a414e12a22 (diff) | |
parent | 62f17a11be4ff2f545148a9e14a0d4806398765a (diff) | |
download | Qt-a3cd7065c5b630d9d949cc53db36f5c2d091c9fc.zip Qt-a3cd7065c5b630d9d949cc53db36f5c2d091c9fc.tar.gz Qt-a3cd7065c5b630d9d949cc53db36f5c2d091c9fc.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging:
Cocoa: QFileDialog: fix filename filter not applied correctly
Fix typo in docs: occurred.
Cocoa: fix qtabwidget auto test failure
Cocoa: fix qwidget auto test failures
Cocoa: Fix qgraphicsproxywidget auto test
Use Q_SLOTS instead of slots in public headers.
Fix a11y crash: dock doesn't always have a widget.
Fix typo in comment.
Mac: respect WA_ShowWithoutActivating flag
Remove misleading and incorrect information from dropMimeData docs.
Provide the resetInternalData slot to cleanly reset data in proxy subclasses.
Mac: switch raster off as default paint engine
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qabstractitemmodel.cpp | 37 | ||||
-rw-r--r-- | src/corelib/kernel/qabstractitemmodel.h | 3 |
2 files changed, 33 insertions, 7 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index b7ac6aa..ddf1fbb 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -1348,6 +1348,26 @@ 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 doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 10 + + \sa modelAboutToBeReset(), modelReset() +*/ +void QAbstractItemModel::resetInternalData() +{ + +} + + +/*! Constructs an abstract item model with the given \a parent. */ QAbstractItemModel::QAbstractItemModel(QObject *parent) @@ -1747,18 +1767,19 @@ QMimeData *QAbstractItemModel::mimeData(const QModelIndexList &indexes) const Returns true if the data and action can be handled by the model; otherwise returns false. - Although the specified \a row, \a column and \a parent indicate the - location of an item in the model where the operation ended, it is the - responsibility of the view to provide a suitable location for where the - data should be inserted. + The specified \a row, \a column and \a parent indicate the location of an + item in the model where the operation ended. It is the responsibility of + the model to complete the action at the correct location. For instance, a drop action on an item in a QTreeView can result in new items either being inserted as children of the item specified by \a row, \a column, and \a parent, or as siblings of the item. - When row and column are -1 it means that it is up to the model to decide - where to place the data. This can occur in a tree when data is dropped on - a parent. Models will usually append the data to the parent in this case. + When \a row and \a column are -1 it means that the dropped data should be + considered as dropped directly on \a parent. Usually this will mean + appending the data as child items of \a parent. If \a row and column are + greater than or equal zero, it means that the drop occurred just before the + specified \a row and \a column in the specified \a parent. \sa supportedDropActions(), {Using drag and drop with item views} */ @@ -2888,6 +2909,7 @@ void QAbstractItemModel::reset() Q_D(QAbstractItemModel); emit modelAboutToBeReset(); d->invalidatePersistentIndexes(); + QMetaObject::invokeMethod(this, "resetInternalData"); emit modelReset(); } @@ -2930,6 +2952,7 @@ void QAbstractItemModel::endResetModel() { Q_D(QAbstractItemModel); d->invalidatePersistentIndexes(); + QMetaObject::invokeMethod(this, "resetInternalData"); emit modelReset(); } diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h index c7af7a2..eab1475 100644 --- a/src/corelib/kernel/qabstractitemmodel.h +++ b/src/corelib/kernel/qabstractitemmodel.h @@ -303,6 +303,9 @@ protected: void setRoleNames(const QHash<int,QByteArray> &roleNames); +protected Q_SLOTS: + void resetInternalData(); + private: Q_DECLARE_PRIVATE(QAbstractItemModel) Q_DISABLE_COPY(QAbstractItemModel) |