From ddfeae974d5a253d84b7b9b03613cf8f8586f4fd Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 9 Jul 2015 21:40:58 +0200 Subject: 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 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/itemviews/qabstractitemview_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/itemviews') 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 QEditorIndexHash; typedef QHash QIndexEditorHash; typedef QPair QItemViewPaintPair; -typedef QList QItemViewPaintPairs; +typedef QVector QItemViewPaintPairs; class QEmptyModel : public QAbstractItemModel { -- cgit v1.2.1