summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp12
-rw-r--r--src/corelib/kernel/qabstractitemmodel.h4
2 files changed, 12 insertions, 4 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index fbeb59a5536..cbbb20a8c9f 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -1306,7 +1306,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
*/
/*!
- \fn void QAbstractItemModel::layoutAboutToBeChanged()
+ \fn void QAbstractItemModel::layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>())
\since 4.2
This signal is emitted just before the layout of a model is changed.
@@ -1316,11 +1316,15 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
Subclasses should update any persistent model indexes after emitting
layoutAboutToBeChanged().
+ The optional @p parents parameter is used to give a more specific notification
+ about what parts of the layout of the model are changing. An empty list indicates
+ a change to the layout of the entire model.
+
\sa layoutChanged(), changePersistentIndex()
*/
/*!
- \fn void QAbstractItemModel::layoutChanged()
+ \fn void QAbstractItemModel::layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>())
This signal is emitted whenever the layout of items exposed by the model
has changed; for example, when the model has been sorted. When this signal
@@ -1332,6 +1336,10 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
altering the structure of the data you expose to views, and emit
layoutChanged() after changing the layout.
+ The optional @p parents parameter is used to give a more specific notification
+ about what parts of the layout of the model are changing. An empty list indicates
+ a change to the layout of the entire model.
+
Subclasses should update any persistent model indexes before emitting
layoutChanged(). In other words, when the structure changes:
diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h
index 97c5b58482f..0aa81446021 100644
--- a/src/corelib/kernel/qabstractitemmodel.h
+++ b/src/corelib/kernel/qabstractitemmodel.h
@@ -233,8 +233,8 @@ public:
Q_SIGNALS:
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet<int> &roles = QSet<int>());
void headerDataChanged(Qt::Orientation orientation, int first, int last);
- void layoutChanged();
- void layoutAboutToBeChanged();
+ void layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>());
+ void layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>());
#if !defined(Q_MOC_RUN) && !defined(qdoc)
private: // can only be emitted by QAbstractItemModel