From 26a73e1b3127f5e41a73b90121110d3533f4ad60 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Wed, 3 Aug 2022 10:26:58 +0200 Subject: 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 Reviewed-by: Thiago Macieira --- src/xml/doc/src/qt6-changes.qdoc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/xml/doc/src/qt6-changes.qdoc') 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 -- cgit v1.2.3