Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
None
-
8
-
Team A Foundation Sprint 60, Foundation Sprint 61, Foundation Sprint 62, Foundation Sprint 63
Description
QTBUG-104130 requires adding a way of configuring how the whitespace-only text nodes are handled by QDomDocument::setContent(). The natural way of doing it is adding one more parameter to setContent(). Considering that there are 7 overloads of setContent() already, adding one more parameter will require adding 7 more overloads. If we decide to add other options in future (for example invalid data handling option, see QTBUG-104474), the number of overloads will double, so this approach doesn't scale. A cleaner option would be adding a way of passing multiple parse options to setContent() (e.g. via a new ParseOptions type, as suggested by Marc in comments of https://codereview.qt-project.org/c/qt/qtbase/+/415926). Then we could also handle the namespaceProcessing argument via the parse options.
Other improvements suggested by Marc:
- Introduce a new Result struct for the output parameters (errorMsg, errorLine, errorColumn)
- Use QAnyStringView for the string arguments.
Attachments
Issue Links
- is required for
-
QTBUG-104130 QDomDocument::setContent() with QXmlStreamReader discards whitespace-only Text nodes
-
- Closed
-
-
QTBUG-89690 Functions and classes that allow to get whitespace-only text nodes are deprecated without any alternatives
-
- Closed
-
-
QTBUG-90003 Add a means to allow whitespace to be preserved when using QDomDocument
-
- Closed
-
For Gerrit Dashboard: QTBUG-104507 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
419211,17 | Improve QDomDocument::setContent() API | dev | qt/qtbase | Status: MERGED | +2 | 0 |
419661,10 | QDomDocument: deprecate old setContent() overloads in favor of new ones | dev | qt/qtbase | Status: MERGED | +2 | 0 |
421643,4 | Port away from deprecated QDomDocument::setContent() overload | dev | qt/qt5compat | Status: MERGED | +2 | 0 |
421644,6 | Port away from deprecated QDomDocument::setContent() overload | dev | qt/qttools | Status: MERGED | +2 | 0 |
423123,2 | Prepare for usage of the new QDomDocument::setContent() overload | dev | qt/qt5compat | Status: MERGED | +2 | 0 |