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:
parent
5335e6a558
commit
1d8b6597a3
@ -10829,9 +10829,7 @@ void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic
|
|||||||
range.start = 0;
|
range.start = 0;
|
||||||
range.length = layout.text().length();
|
range.length = layout.text().length();
|
||||||
range.format.setTextOutline(d->pen);
|
range.format.setTextOutline(d->pen);
|
||||||
QVector<QTextLayout::FormatRange> formats;
|
layout.setFormats(QVector<QTextLayout::FormatRange>(1, range));
|
||||||
formats.append(range);
|
|
||||||
layout.setFormats(formats);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setupTextLayout(&layout);
|
setupTextLayout(&layout);
|
||||||
|
Loading…
Reference in New Issue
Block a user