diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-04-18 13:20:11 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-04-18 13:30:54 (GMT) |
commit | 1d28996fd635eed07eff61502ab67f7158ba43cd (patch) | |
tree | b34ed13c265d3ce8733b634592ac55808d211384 /src/declarative | |
parent | 518c2a58ed6fdfd7449cb4476aa8ea0d32ad16e3 (diff) | |
download | Qt-1d28996fd635eed07eff61502ab67f7158ba43cd.zip Qt-1d28996fd635eed07eff61502ab67f7158ba43cd.tar.gz Qt-1d28996fd635eed07eff61502ab67f7158ba43cd.tar.bz2 |
Support text decoration in QML when using static text back-end
When the QStaticTextItem code path in QML was copy-pasted, QStaticText
did not support text decoration yet. It has since been implemented.
We copy-paste the fix as well (which means we have to export a
private function from QtGui to avoid duplicating that code as well.)
Task-number: QTBUG-18428
Reviewed-by: Jiang Jiang
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextlayout.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp index c5f40b3..75d9f67 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -327,6 +327,12 @@ void QDeclarativeTextLayout::prepare(QPainter *painter) } } +// Defined in qpainter.cpp +extern Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray, + const QFixedPoint *positions, int glyphCount, + QFontEngine *fontEngine, const QFont &font, + const QTextCharFormat &charFormat); + void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p) { QPainterPrivate *priv = QPainterPrivate::get(painter); @@ -372,6 +378,10 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p) currentColor = item.color; } priv->extended->drawStaticTextItem(&item); + + qt_draw_decoration_for_glyphs(painter, item.glyphs, item.glyphPositions, + item.numGlyphs, item.fontEngine(), painter->font(), + QTextCharFormat()); } if (currentColor != oldPen.color()) painter->setPen(oldPen); |