From bec817334705d86bc4e99af2e7220bb877f036d3 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Thu, 3 Jan 2019 15:57:37 +0100 Subject: QPainter: replace an QVector with QVarLengthArray We usually do not keep a lot of QPainter states, but we need to call 1 allocation and 1 reallocation for keep 4 states. It will be better to use QVarLengthArray with preallocation for 8 states. Change-Id: Iacb6aa7a73807491534b1a915453f218d6e4305b Reviewed-by: Eirik Aavitsland --- src/gui/painting/qpainter_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h index 2d44577310..930180e9fa 100644 --- a/src/gui/painting/qpainter_p.h +++ b/src/gui/painting/qpainter_p.h @@ -51,6 +51,7 @@ // We mean it. // +#include #include #include "QtGui/qbrush.h" #include "QtGui/qfont.h" @@ -202,7 +203,7 @@ public: QPainterPrivate **d_ptrs; QPainterState *state; - QVector states; + QVarLengthArray states; mutable QPainterDummyState *dummyState; -- cgit v1.2.3