summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-12-01 01:29:23 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-12-01 01:31:47 (GMT)
commitfe90d7a3d9f00fa2ea46c0816f63c65f812c360f (patch)
treec0f286d64a27e0f5269543d43e06cd33135792cb /src/declarative
parent6f18ee7ce50bc9b2688079e923a34c08117b3eb8 (diff)
downloadQt-fe90d7a3d9f00fa2ea46c0816f63c65f812c360f.zip
Qt-fe90d7a3d9f00fa2ea46c0816f63c65f812c360f.tar.gz
Qt-fe90d7a3d9f00fa2ea46c0816f63c65f812c360f.tar.bz2
Change pen correctly when drawing cached text
Task-number: QTBUG-14568
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
index e8da367..14a1109 100644
--- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
@@ -361,10 +361,18 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
d->position = p;
}
+ QPen oldPen = priv->state->pen;
+ QColor currentColor = oldPen.color();
for (int ii = 0; ii < itemCount; ++ii) {
QStaticTextItem &item = d->items[ii];
+ if (item.color.isValid() && currentColor != item.color) {
+ painter->setPen(item.color);
+ currentColor = item.color;
+ }
priv->extended->drawStaticTextItem(&item);
}
+ if (currentColor != oldPen.color())
+ painter->setPen(oldPen);
}
QT_END_NAMESPACE