diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-08-03 10:26:58 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-08-04 22:17:05 +0200 |
commit | 26a73e1b3127f5e41a73b90121110d3533f4ad60 (patch) | |
tree | efb60a8ad56550d0ac0b94c5d10d22855fddefbd /src/xml/doc/src | |
parent | 7ceba9c4723846bc77d94c7bfc62c1a8ff1d9138 (diff) |
QDomDocument: Add a way to enable spacing-only text nodes
Added a parse option that can be passed to setContent(), to specify that
spacing-only text nodes must be preserved.
[ChangeLog][QtXml][QDomDocument] Spacing-only text nodes can now
be preserved by passing the ParseOption::PreserveSpacingOnlyNodes option
to setContent().
Fixes: QTBUG-104130
Fixes: QTBUG-89690
Task-number: QTBUG-90003
Change-Id: Id43730ce5b79a856c4b434d1f1d4dd7c49c25f31
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/xml/doc/src')
-rw-r--r-- | src/xml/doc/src/qt6-changes.qdoc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xml/doc/src/qt6-changes.qdoc b/src/xml/doc/src/qt6-changes.qdoc index 3ee4d103c6..cca6aa9317 100644 --- a/src/xml/doc/src/qt6-changes.qdoc +++ b/src/xml/doc/src/qt6-changes.qdoc @@ -73,6 +73,15 @@ If you use QDomDocument and rely on any of these, you must update your code and XML documents accordingly. + \section3 Spacing-only text nodes + + By default, text nodes containing only spacing characters are stripped + and won't appear in the QDomDocument. The Qt 5 way of changing this behavior + was using the QDomDocument::setContent() overload that allowed a \c QXmlReader + to be supplied. That overload was removed in Qt 6.0, but since Qt 6.5, + you can pass QDomDocument::ParseOption::PreserveSpacingOnlyNodes as a parse + option, to specify that spacing-only text nodes must be preserved. + \section2 Qt Core5 compatibility library If your application or library cannot be ported right now, the \l |