From 84a618809a1fa53ef2c2a4a73604a3d14f5607ca Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 19 Aug 2024 13:31:06 +0200 Subject: [PATCH] doc: Add a note about the difference between block/span properties QTextDocument has different formatting options for spans and blocks, which means that some CSS properties will be ignored if applied to a span, even though they might be respected by a full-blown web browser. Since this can be surprising to users, we add a note about it to the overview of supported HTML. Task-number: QTBUG-127457 Change-Id: I55ccb039849d3ce55b9bfb8be21b6e8d276b86cd Reviewed-by: Eirik Aavitsland --- src/gui/doc/src/richtext.qdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/doc/src/richtext.qdoc b/src/gui/doc/src/richtext.qdoc index 10d99628500..88c6a1137f5 100644 --- a/src/gui/doc/src/richtext.qdoc +++ b/src/gui/doc/src/richtext.qdoc @@ -1249,6 +1249,11 @@ \endlist \endtable + \note Certain CSS properties are only supported when applied to a block tag, such as \c{

}. + Setting these properties on a \c{}, for instance, will have no effect. The margin is one + example of such a property. See QTextBlockFormat and QTextCharFormat for an overview of the + formatting options available on blocks and spans in QTextDocument. + \section1 Qt-specific CSS properties Besides the standard CSS properties listed earlier, the following