From 7db2027d2072a99680abee8d4e5cfaa62b1f3296 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 3 Nov 2011 16:34:47 +1000 Subject: [PATCH] Text.RichText ignores color property Task-number: QTBUG-21921 Change-Id: I2adb9062e658742a704dc55b4def7f6f1eb1f954 Reviewed-by: Damian Jansen --- src/declarative/items/qquicktext.cpp | 2 +- src/declarative/items/qquicktextnode.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/declarative/items/qquicktext.cpp b/src/declarative/items/qquicktext.cpp index 36d15c6..26f9543 100644 --- a/src/declarative/items/qquicktext.cpp +++ b/src/declarative/items/qquicktext.cpp @@ -1728,7 +1728,7 @@ QSGNode *QQuickText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data if (d->richText) { d->ensureDoc(); - node->addTextDocument(bounds.topLeft(), d->doc, QColor(), d->style, d->styleColor); + node->addTextDocument(bounds.topLeft(), d->doc, d->color, d->style, d->styleColor); } else { node->addTextLayout(QPoint(0, bounds.y()), &d->layout, d->color, d->style, d->styleColor); diff --git a/src/declarative/items/qquicktextnode.cpp b/src/declarative/items/qquicktextnode.cpp index fab592f..5cc372f 100644 --- a/src/declarative/items/qquicktextnode.cpp +++ b/src/declarative/items/qquicktextnode.cpp @@ -1174,8 +1174,10 @@ void QQuickTextNode::addTextDocument(const QPointF &, QTextDocument *textDocumen } textPos += text.length(); } else { - if (!textColor.isValid()) + if (charFormat.foreground().style() != Qt::NoBrush) engine.setTextColor(charFormat.foreground().color()); + else + engine.setTextColor(textColor); int fragmentEnd = textPos + fragment.length(); if (preeditPosition >= 0 -- 2.7.4