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 <eirik.aavitsland@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2024-08-19 13:31:06 +02:00
parent 7c7b34f76a
commit 84a618809a

View File

@ -1249,6 +1249,11 @@
\endlist
\endtable
\note Certain CSS properties are only supported when applied to a block tag, such as \c{<p>}.
Setting these properties on a \c{<span>}, 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