summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-08-25 06:08:50 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-08-25 06:08:50 (GMT)
commit36223d1aeb079a9628d403f87112da3b59652ba0 (patch)
tree5e7f20aba5883944d0fe5a0bc6aefd43d6cbb999
parent0700370cb4f49483c24887d6bd8175df730954ed (diff)
downloadQt-36223d1aeb079a9628d403f87112da3b59652ba0.zip
Qt-36223d1aeb079a9628d403f87112da3b59652ba0.tar.gz
Qt-36223d1aeb079a9628d403f87112da3b59652ba0.tar.bz2
Alignment of shadow for rich text is broken when using text styles
Task-number: QTBUG-13142
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index b96b43c..e5ad743 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1047,10 +1047,10 @@ QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle)
QAbstractTextDocumentLayout::PaintContext context;
+ QTextOption oldOption(doc->defaultTextOption());
if (drawStyle) {
context.palette.setColor(QPalette::Text, styleColor);
- // ### Do we really want this?
- QTextOption colorOption;
+ QTextOption colorOption(doc->defaultTextOption());
colorOption.setFlags(QTextOption::SuppressColors);
doc->setDefaultTextOption(colorOption);
} else {
@@ -1058,7 +1058,7 @@ QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle)
}
doc->documentLayout()->draw(&p, context);
if (drawStyle)
- doc->setDefaultTextOption(QTextOption());
+ doc->setDefaultTextOption(oldOption);
return img;
}