diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-02-21 15:18:00 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-05-30 15:01:10 +0000 |
commit | 1d8b6597a36f266c3384553365326cf7ec9f8641 (patch) | |
tree | be0211d3e8d3161d28ea6d7187c312137e34e0b3 /src/widgets/graphicsview/qgraphicsitem.cpp | |
parent | 5335e6a558a0aa8b86b9c564f91c6ec10380c7af (diff) |
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>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index d0a16690e6..1fdbe0fc18 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -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); |