diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 9c04617983..c3f841c7b6 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -480,6 +480,15 @@ void StdCmdFreezeViews::onRestoreViews() } QDomDocument xmlDocument; + +#if QT_VERSION >= QT_VERSION_CHECK(6,5,0) + if (const auto result = xmlDocument.setContent(&file, QDomDocument::ParseOption::UseNamespaceProcessing); !result) { + std::cerr << "Parse error in XML content at line " << result.errorLine + << ", column " << result.errorColumn << ": " + << qPrintable(result.errorMessage) << std::endl; + return; + } +#else QString errorStr; int errorLine; int errorColumn; @@ -491,6 +500,7 @@ void StdCmdFreezeViews::onRestoreViews() << (const char*)errorStr.toLatin1() << std::endl; return; } +#endif // get the root element QDomElement root = xmlDocument.documentElement(); diff --git a/src/Gui/DocumentRecovery.cpp b/src/Gui/DocumentRecovery.cpp index 561b8cdd75..a02d768e94 100644 --- a/src/Gui/DocumentRecovery.cpp +++ b/src/Gui/DocumentRecovery.cpp @@ -469,6 +469,11 @@ DocumentRecoveryPrivate::XmlConfig DocumentRecoveryPrivate::readXmlFile(const QS if (!file.open(QFile::ReadOnly)) return cfg; +#if QT_VERSION >= QT_VERSION_CHECK(6,5,0) + if (!domDocument.setContent(&file, QDomDocument::ParseOption::UseNamespaceProcessing)) { + return cfg; + } +#else QString errorStr; int errorLine; int errorColumn; @@ -477,6 +482,7 @@ DocumentRecoveryPrivate::XmlConfig DocumentRecoveryPrivate::readXmlFile(const QS &errorColumn)) { return cfg; } +#endif QDomElement root = domDocument.documentElement(); if (root.tagName() != QLatin1String("AutoRecovery")) {