From f9caf48beebb935c7c1ca71745b2646b872b65d1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 7 Jun 2012 10:39:42 +0200 Subject: Use a QVector instead of a QSet in itemviews/models. The QSet 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 Reviewed-by: Olivier Goffart --- src/corelib/itemmodels/qabstractitemmodel.cpp | 9 +++++---- src/corelib/itemmodels/qabstractitemmodel.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/corelib/itemmodels') 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 &roles = QSet()) + \fn void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) 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 #include #include -#include +#include QT_BEGIN_HEADER @@ -243,7 +243,7 @@ public: #endif Q_SIGNALS: - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet &roles = QSet()); + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()); void headerDataChanged(Qt::Orientation orientation, int first, int last); void layoutChanged(const QList &parents = QList()); void layoutAboutToBeChanged(const QList &parents = QList()); -- cgit v1.2.3