From 287b53295375dbabc5ef820ebd8c181801e6354c Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Fri, 17 Jul 2026 07:52:03 +0000 Subject: [PATCH] templatescollection.cpp: fix QDomDocument::ParseResult->bool conversion Since Qt 6.5, QDomDocument::setContent() returns a ParseResult struct with an *explicit* operator bool(), so 'bool x = doc.setContent(...)' (copy-initialization) no longer compiles - explicit conversions aren't considered there. This exact issue was already fixed in titleblocktemplate.cpp by dropping the intermediate bool and testing the call directly in the if condition (contextual bool conversion in an if() is fine even for an explicit operator bool), but this second occurrence in templatescollection.cpp used the same pattern and was missed. Applying the same fix here for consistency. --- sources/titleblock/templatescollection.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/titleblock/templatescollection.cpp b/sources/titleblock/templatescollection.cpp index 216ef8db7..5ffc44caf 100644 --- a/sources/titleblock/templatescollection.cpp +++ b/sources/titleblock/templatescollection.cpp @@ -454,8 +454,7 @@ QDomElement TitleBlockTemplatesFilesCollection::getTemplateXmlDescription(const } QDomDocument *xml_document = new QDomDocument(); - bool xml_parsing = xml_document -> setContent(&xml_file); - if (!xml_parsing) { + if (!xml_document -> setContent(&xml_file)) { delete xml_document; return(QDomElement()); }