summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-09-22 08:11:41 (GMT)
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 10:24:47 (GMT)
commit451ec46701553e6516065c0a7a36613f70a10c9b (patch)
tree5215b9c4af83550e7ef9c03626d1b81f2f479847 /src/gui
parentb855615b228bdb3ff9583a8342684d79acb46128 (diff)
downloadQt-451ec46701553e6516065c0a7a36613f70a10c9b.zip
Qt-451ec46701553e6516065c0a7a36613f70a10c9b.tar.gz
Qt-451ec46701553e6516065c0a7a36613f70a10c9b.tar.bz2
Keep other text format with QTextOption::SuppressColors tag on
Setting the QTextOption::SuppressColors tag on a QTextDocument breaks all text format, not just colors. This patch fix this by selectively ignoring color properties in the format and keeping other properties. Task-number: QTBUG-13090 Reviewed-by: Eskil
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextlayout.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index f2d3de1..3c48b1c 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2258,8 +2258,12 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
QTextCharFormat format;
if (eng->hasFormats() || selection) {
- if (!suppressColors)
- format = eng->format(&si);
+ format = eng->format(&si);
+ if (suppressColors) {
+ format.clearForeground();
+ format.clearBackground();
+ format.clearProperty(QTextFormat::TextUnderlineColor);
+ }
if (selection)
format.merge(selection->format);