diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-07-09 21:40:58 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-07-13 10:37:52 +0000 |
commit | ddfeae974d5a253d84b7b9b03613cf8f8586f4fd (patch) | |
tree | e45c817b4c7dd437603fa82062a5c81c44d2ad60 /src/widgets/itemviews/qabstractitemview_p.h | |
parent | 14235ada48d5f3015571102549d56c8cfbcdcccb (diff) | |
download | qtbase-ddfeae974d5a253d84b7b9b03613cf8f8586f4fd.tar.gz |
QAbstractItemView: don't hold QItemViewPaintPair in a QList
QItemViewPaintPair is larger than a void*, so holding it in QList
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by holding in a QVector instead (was already marked movable
as a QPair of movable types).
Change-Id: I6f4042d2df306ecf0ec576ecbc6678736268014e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/itemviews/qabstractitemview_p.h')
-rw-r--r-- | src/widgets/itemviews/qabstractitemview_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index 016c50436b..bb88b25652 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -74,7 +74,7 @@ typedef QHash<QWidget *, QPersistentModelIndex> QEditorIndexHash; typedef QHash<QPersistentModelIndex, QEditorInfo> QIndexEditorHash; typedef QPair<QRect, QModelIndex> QItemViewPaintPair; -typedef QList<QItemViewPaintPair> QItemViewPaintPairs; +typedef QVector<QItemViewPaintPair> QItemViewPaintPairs; class QEmptyModel : public QAbstractItemModel { |