diff options
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 6 |
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; } |