Marc Mutz f1bf3cc6ee tst_QDialogButtonBox: fix memleak in hideAndShowButton()
The old code created the top-level widget on the heap, without a
parent, so the test function leaked it.

Fix by creating on the stack instead.

This means we need to move the definition to before that of the child
button box (itself created on the stack), to avoid the double-delete
that would happen if the automatic parent would delete its QObject
child and then the compiler deletes the child again because it, too,
is an automatic variable. If, OTOH, the parent is declared before the
child, the child will have unregistered itself from its parent when it
was deleted.

Amends bbb71e7e80f292c2e69faef81b1624832981147e.

Pick-to: 6.8 6.5
Change-Id: I9489daace3bbbeecfaedcb5780a6b29a82c8d4ff
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8352112e580bad1e95de39088d673d0d8954119f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-28 16:32:19 +00:00
2025-03-24 18:27:25 +00:00
2024-11-05 14:36:16 +01:00
2024-11-05 14:36:16 +01:00
2025-03-25 08:40:27 +00:00
2024-06-25 11:44:00 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%