Marc Mutz 9de65d3d68 tst_QWidget: don't leak QStyle objects
The result of QStyleFactory::create() must be deleted by the caller.

Some test functions stored it in a QScopedPointer, while others
didn't, each causing a leak of a QWindowsStyle object.

DRY the test functions (except the one that checks that 'delete
widget.style();' works) by introducing an owning pointer at the test
class level, to be reused by test functions. This is not so much for
caching the object across test functions (though this is a nice
benefit, too), but in order to keep the owning pointer out of the test
functions, and allow most functions to just do

   setStyle(deterministicStyle()).

Found by ASAN.

On my machine, this test is now ASAN-clean, except a) the usual
cp-demangle.c leak and b) destroyedSignal(), which still leaks.

As a drive-by, pass a QStringLiteral instead of QL1SV to
QStyleFactory::create() and port one QVERIFY( != ) to QCOMPARE_NE().

No amends, it'd be too many. Not picking back far, because others
don't care, and I expect lots of conflicts when backporting, due to
many different amended commits.

Change-Id: Ie9e7faf21bc177e08af56c659dc58870ad3cf6ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5be58ac9271555eed3a2884d827f30c164d2277d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-27 12:41:42 +00:00
2025-03-24 18:27:25 +00:00
2024-11-05 14:36:16 +01:00
2015-08-18 19:59:14 +00: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%