diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-06-30 13:34:44 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-08-17 17:02:27 +0200 |
commit | e684c25b859cfa1cf2cd93c8c9be374ee6f6a289 (patch) | |
tree | c60bd09d83a32f446473032069ca731052ee54eb /examples/xml | |
parent | 2f7a78cd7b3351bc7a1a209d0822769d111f246b (diff) |
QDomDocument: deprecate old setContent() overloads in favor of new ones
And use the new overloads in examples and tests.
[ChangeLog][QtXml][QDomDocument] Deprecated the old setContent()
overloads in favor of the new ones that take ParseOptions and
ParseError.
Task-number: QTBUG-104507
Change-Id: I61b37eba2fe3002c03bddc90f6877676d539f7ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/xml')
-rw-r--r-- | examples/xml/dombookmarks/xbeltree.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/examples/xml/dombookmarks/xbeltree.cpp b/examples/xml/dombookmarks/xbeltree.cpp index ed3ab791bd..5d2e14f198 100644 --- a/examples/xml/dombookmarks/xbeltree.cpp +++ b/examples/xml/dombookmarks/xbeltree.cpp @@ -53,17 +53,14 @@ void XbelTree::contextMenuEvent(QContextMenuEvent *event) bool XbelTree::read(QIODevice *device) { - QString errorStr; - int errorLine; - int errorColumn; - - if (!domDocument.setContent(device, true, &errorStr, &errorLine, - &errorColumn)) { + QDomDocument::ParseResult result = + domDocument.setContent(device, QDomDocument::ParseOption::UseNamespaceProcessing); + if (!result) { QMessageBox::information(window(), tr("DOM Bookmarks"), tr("Parse error at line %1, column %2:\n%3") - .arg(errorLine) - .arg(errorColumn) - .arg(errorStr)); + .arg(result.errorLine) + .arg(result.errorColumn) + .arg(result.errorMessage)); return false; } |