qdoc: Ensure the generated temporary header file is closed properly
requested to merge asturmlechner/qttools:asturmlechner/QTBUG-109614-qdoc-no-truncated-writes into kde/5.15
Use the correct scope for the QFile object used for writing the temporary header file; this ensures that the associated QTextStream object is destroyed first and its contents flushed before destroying the QFile, potentially leading to truncated writes to the file.
Pick-to: 6.5 6.4 6.2 5.15 Done-with: Simon Geisseler Fixes: QTBUG-109614 Change-Id: Ic6a68c0b52219ce607a5116c730862ee0cb37f04 Reviewed-by: Luca Di Sera luca.disera@qt.io (cherry picked from commit 0d8837c4)
Note: The 5.15 backport seems to have been forgotten about, upstream, but it sounds like something in real need of fixing. Backported by decomposing C++17 if-initialisation into something C++11 will take - builds without warnings.