tst_QMessageBox: test staticsSourceCompat() also with a parent


The old tests only ever passed nullptr parents, but to fix
QTBUG-150912 (crash on parent deletion while dialog is in exec()), we
need a to hae a variant that has a non-null parent.

Since the goal is to fix a crash on deleted parent, prepare the code
for that already, but using a QAutoPointer for the parent, and
re-checking for every individual test whether it needs to be
re-created.

Pick-to: 6.12 6.8
Task-number: QTBUG-150912
Task-number: QTBUG-54693
Change-Id: Ia3197c6de73aa383218d8e58d814b424ac8c2db6
Reviewed-by: Qt Review Bot <qt_reviewbot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
commit4053f2e82f776bb58ace844d7793f6f8304e2534
parentfbdbfbed712117219fbc682d03b49df01d953694
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeWed, 21 Oct 2026 10:59:16 +0000