summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2011-11-21 13:34:24 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-21 14:24:36 +0100
commit100908e400be65fea74184caaee754abc3a5afcb (patch)
tree0e99ca3012c603cbbfc65f09245dba6d606bc67d /src
parent448e1e620ca206236bf6d03406fceb9b9eb20c15 (diff)
Add a roles argument to the dataChanged signal.
This allows more granular reporting of what has changed. This change is binary incompatible and source compatible. Change-Id: I7c5beaee651a24780cc94e41383f7a80210bc603 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp6
-rw-r--r--src/corelib/kernel/qabstractitemmodel.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index bda25c301e..fbeb59a553 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -1415,7 +1415,7 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
+ \fn void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet<int> &roles = QSet<int>())
This signal is emitted whenever the data in an existing item changes.
@@ -1426,6 +1426,10 @@ QAbstractItemModel::~QAbstractItemModel()
When reimplementing the setData() function, this signal must be emitted
explicitly.
+ The optional roles argument can be used to specify which data roles have actually
+ been modified. An empty set in the roles argument means that all roles should be
+ considered modified.
+
\sa headerDataChanged(), setData(), layoutChanged()
*/
diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h
index c7af7a284f..97c5b58482 100644
--- a/src/corelib/kernel/qabstractitemmodel.h
+++ b/src/corelib/kernel/qabstractitemmodel.h
@@ -45,6 +45,7 @@
#include <QtCore/qvariant.h>
#include <QtCore/qobject.h>
#include <QtCore/qhash.h>
+#include <QtCore/qset.h>
QT_BEGIN_HEADER
@@ -230,7 +231,7 @@ public:
#endif
Q_SIGNALS:
- void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
+ 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();