summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicstext.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-02-23 12:02:52 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-02-23 12:02:52 (GMT)
commitde4332a4728e739b37e9c7b04c021e150e096270 (patch)
tree619aae505826654f3d89492efa53f758214fea6f /src/declarative/graphicsitems/qmlgraphicstext.cpp
parenta419d587a666aaf55310b3a18e9f9e1993fef16e (diff)
parent3db40b0be40c946f547f238ed3f0af813892115e (diff)
downloadQt-de4332a4728e739b37e9c7b04c021e150e096270.zip
Qt-de4332a4728e739b37e9c7b04c021e150e096270.tar.gz
Qt-de4332a4728e739b37e9c7b04c021e150e096270.tar.bz2
Merge remote branch 'origin/master'
Conflicts: doc/src/declarative/advtutorial1.qdoc doc/src/declarative/tutorial2.qdoc doc/src/declarative/tutorial3.qdoc src/declarative/graphicsitems/qmlgraphicsmousearea.cpp src/multimedia/playback/qmediaplayer.cpp
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicstext.cpp')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstext.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicstext.cpp b/src/declarative/graphicsitems/qmlgraphicstext.cpp
index 6906534..57b44d2 100644
--- a/src/declarative/graphicsitems/qmlgraphicstext.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstext.cpp
@@ -555,6 +555,7 @@ void QmlGraphicsTextPrivate::updateSize()
else
doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
dy -= (int)doc->size().height();
+ cachedLayoutSize = doc->size().toSize();
}
int yoff = 0;
@@ -770,7 +771,7 @@ void QmlGraphicsText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidg
{
Q_D(QmlGraphicsText);
- if (d->cache || d->richText || d->style != Normal) {
+ if (d->cache || d->style != Normal) {
d->checkImgCache();
if (d->imgCache.isNull())
return;
@@ -847,7 +848,15 @@ void QmlGraphicsText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidg
p->save();
p->setClipRect(boundingRect(), Qt::IntersectClip);
}
- d->drawWrappedText(p, QPointF(0,y), false);
+ if (d->richText) {
+ QAbstractTextDocumentLayout::PaintContext context;
+ context.palette.setColor(QPalette::Text, d->color);
+ p->translate(0, y);
+ d->doc->documentLayout()->draw(p, context);
+ p->translate(0, -y);
+ } else {
+ d->drawWrappedText(p, QPointF(0,y), false);
+ }
if (needClip)
p->restore();
}