Merge pull request #1085 from ispyisail/fix/1080-parseoption-qt65

Fix the build on Qt older than 6.5 (#1080)
This commit is contained in:
Laurent Trinques
2026-09-27 21:46:11 +02:00
committed by GitHub
+6
View File
@@ -386,7 +386,13 @@ QETProject::ProjectState QETProject::openFile(QFile *file)
// QET::findInDomElement()), so the extra whitespace-only text nodes
// this keeps around are inert everywhere but the two elements that
// call .text() on themselves -- which is exactly where the bug was.
// The option exists since Qt 6.5; older Qt always drops such nodes,
// so there an all-whitespace value still reloads as "".
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
if (!xml_project.setContent(content, QDomDocument::ParseOption::PreserveSpacingOnlyNodes))
#else
if (!xml_project.setContent(content))
#endif
{
if(opened_here) {
file->close();