diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-05-06 21:13:29 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-05-07 17:00:20 +0200 |
commit | 688602704d5c5226491b0d0ab7f596f9568966d6 (patch) | |
tree | 750f50589fe77ebfe214a7a113c7a6d26011d96a /src/gui/text/qtextdocument.cpp | |
parent | 05f7dd5ead5927ef7b3301380b81d7194d9e0593 (diff) |
Support CSS text-decoration-color in underlines, overlines, strikethrough
Also add a feature to the textedit example to set this value.
[ChangeLog][QtGui][CSS] The CSS text-decoration-color attribute is now
supported in rich text spans with underlines, overlines and strikethrough.
Fixes: QTBUG-82114
Task-number: QTBUG-39617
Change-Id: I0065cb5431833da55b0f503ce7ff2b83b74b718a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 2c0c3582ed..d3bec57bd4 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2560,6 +2560,11 @@ bool QTextHtmlExporter::emitCharFormatStyle(const QTextCharFormat &format) if (!atLeastOneDecorationSet) html += QLatin1String("none"); html += QLatin1Char(';'); + if (format.hasProperty(QTextFormat::TextUnderlineColor)) { + html += QLatin1String(" text-decoration-color:"); + html += colorValue(format.underlineColor()); + html += QLatin1Char(';'); + } attributesEmitted = true; } else { html.chop(decorationTag.size()); |