diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-06-07 10:39:42 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-12 04:30:07 +0200 |
commit | f9caf48beebb935c7c1ca71745b2646b872b65d1 (patch) | |
tree | cce24c1336eb0cc1ce422292623eb6f34c18f553 /src/corelib/itemmodels | |
parent | 3df316e9615027d9384cef81ac6cbfa2f9f81f01 (diff) |
Use a QVector<int> instead of a QSet<int> in itemviews/models.
The QSet<int> is a more expensive container to use and create, so
it should be avoided.
This is source incompatible compared to earlier Qt 5 for
QAbstractItemView subclasses which reimplement dataChanged, but this
patch changes nothing compared to already-present SiC compared
to Qt 4.
Change-Id: Id95391dfd62a0a7f487a8765790b007badefb937
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.cpp | 9 | ||||
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.h | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index dc53021432..0b390341e4 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -1416,7 +1416,7 @@ QAbstractItemModel::~QAbstractItemModel() */ /*! - \fn void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet<int> &roles = QSet<int>()) + \fn void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) This signal is emitted whenever the data in an existing item changes. @@ -1427,9 +1427,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. + The optional \a roles argument can be used to specify which data roles have actually + been modified. An empty vector in the roles argument means that all roles should be + considered modified. The order of elements in the roles argument does not have any + relevance. \sa headerDataChanged(), setData(), layoutChanged() */ diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h index ff96fe53d6..976c1600c6 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.h +++ b/src/corelib/itemmodels/qabstractitemmodel.h @@ -45,7 +45,7 @@ #include <QtCore/qvariant.h> #include <QtCore/qobject.h> #include <QtCore/qhash.h> -#include <QtCore/qset.h> +#include <QtCore/qvector.h> QT_BEGIN_HEADER @@ -243,7 +243,7 @@ public: #endif Q_SIGNALS: - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet<int> &roles = QSet<int>()); + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()); void headerDataChanged(Qt::Orientation orientation, int first, int last); void layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>()); void layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>()); |