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>
bb10
Marc Mutz 2015-07-09 21:40:58 +02:00
parent 14235ada48
commit ddfeae974d
1 changed files with 1 additions and 1 deletions

View File

@ -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
{