QPicture: don't hold pixmaps in QList

QPixmap is larger than a void*, so holding them in a 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.

Change-Id: I82bb9a88e7030e566f39421cd78babcf01bce285
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2014-08-16 12:25:52 +02:00
parent 1f46321717
commit d0b659f183

View File

@ -48,6 +48,7 @@
#include "QtCore/qatomic.h" #include "QtCore/qatomic.h"
#include "QtCore/qbuffer.h" #include "QtCore/qbuffer.h"
#include "QtCore/qobjectdefs.h" #include "QtCore/qobjectdefs.h"
#include "QtCore/qvector.h"
#include "QtGui/qpicture.h" #include "QtGui/qpicture.h"
#include "QtGui/qpixmap.h" #include "QtGui/qpixmap.h"
#include "QtGui/qpen.h" #include "QtGui/qpen.h"
@ -151,7 +152,7 @@ public:
QScopedPointer<QPaintEngine> paintEngine; QScopedPointer<QPaintEngine> paintEngine;
bool in_memory_only; bool in_memory_only;
QList<QImage> image_list; QList<QImage> image_list;
QList<QPixmap> pixmap_list; QVector<QPixmap> pixmap_list;
QList<QBrush> brush_list; QList<QBrush> brush_list;
QList<QPen> pen_list; QList<QPen> pen_list;
}; };