QGraphicsWidget: micro-optimization

Pass a temporary QVector instead of a named variable. Apart from less function
calls, it also makes the code C++11-ready (enables move semantics).

Change-Id: Ia7d3bed8aeae48453f96dc3c979f7ae394a5a26d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This commit is contained in:
Marc Mutz 2014-02-21 15:18:00 +01:00
parent 5335e6a558
commit 1d8b6597a3

View File

@ -10829,9 +10829,7 @@ void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic
range.start = 0;
range.length = layout.text().length();
range.format.setTextOutline(d->pen);
QVector<QTextLayout::FormatRange> formats;
formats.append(range);
layout.setFormats(formats);
layout.setFormats(QVector<QTextLayout::FormatRange>(1, range));
}
setupTextLayout(&layout);