diff options
author | Eskil Abrahamsen Blomfeldt <[email protected]> | 2024-03-15 15:42:51 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <[email protected]> | 2024-03-18 20:28:36 +0100 |
commit | 6ee5fcc45637bf45ecd7d5412db8ab58bde7fe39 (patch) | |
tree | 2a3c4ee8672f6411dba33d978d0306dd999baa6f /src/gui/text/qtexthtmlparser.cpp | |
parent | e205edfff611922ddf04d8de71ed9cb92704eafc (diff) |
Support foreground gradient in CSS parser and HTML generator
Qt supports some complex foreground brushes which we cannot
express using normal CSS, so we introduce a Qt-specific property
for this. We already had some support for background gradients
in widget style sheets, but this expands support to foreground
brushes of text when converting a QTextDocument from and to HTML.
It also adds an optional "coordinatemode" attribute to the
gradient functions so that this can be faithfully restored from HTML.
Task-number: QTBUG-123357
Change-Id: I3d6dd828f68272995c8525bec5a7b421fdbed670
Reviewed-by: Eirik Aavitsland <[email protected]>
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
-rw-r--r-- | src/gui/text/qtexthtmlparser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index df6e6788277..05b9a1385f1 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1405,6 +1405,12 @@ void QTextHtmlParserNode::applyCssDeclarations(const QList<QCss::Declaration> &d } break; } + case QCss::QtForeground: + { + QBrush brush = decl.brushValue(); + charFormat.setForeground(brush); + break; + } default: break; } } |