QGraphicsSimpleTextItem: Fix drawing the outline with pen, when set

QTextLayout's setAdditionalFormats() is expected to invalidate
the shaping results, so that the layouting must be done *after*
the format range(s) gets applied.

Task-number: QTBUG-33475
Change-Id: I6b948fc179da915545a98ac36f2c20163947ec9e
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Konstantin Ritt 2014-03-15 01:11:14 +02:00 committed by The Qt Project
parent 0a803dc90a
commit 946c092554

View File

@ -10778,7 +10778,6 @@ void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic
tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
QStackTextEngine engine(tmp, d->font);
QTextLayout layout(&engine);
setupTextLayout(&layout);
QPen p;
p.setBrush(d->brush);
@ -10795,6 +10794,7 @@ void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic
layout.setAdditionalFormats(formats);
}
setupTextLayout(&layout);
layout.draw(painter, QPointF(0, 0));
if (option->state & (QStyle::State_Selected | QStyle::State_HasFocus))