From 688602704d5c5226491b0d0ab7f596f9568966d6 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 6 May 2021 21:13:29 +0200 Subject: 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 --- src/gui/text/qtextdocument.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/text/qtextdocument.cpp') 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()); -- cgit v1.2.3