qt5base-lts/tests/auto/widgets
Volker Hilsheimer f0049873d2 QMenu: don't crash when nested tear-off menus are closed
QMenu's causedStack maintains a list of menus on the way to the menu,
and might contain nullptr if one of the entries was a tear-off menu
that got closed (and thus destroyed, due to DeleteOnClose).

If the entry we get from the stack is nullptr, fall back to the passed-
in parent widget pointer, and test for nullptr before accessing.

Add a test case that crashes without the fix.

Fixes: QTBUG-112217
Pick-to: 6.6 6.5 6.2
Change-Id: I958182db47c3cc8733e1780f7efef43881ffae11
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-09 00:08:36 +02:00
..
dialogs Allow disable native messagebox dialog 2023-05-02 10:37:17 +02:00
effects tests: blacklist tst_QGraphicsEffect::draw() on Wayland 2023-04-17 16:05:24 +02:00
graphicsview tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
itemviews Use boolean to indicate QTableWidgetItem is header item 2023-05-05 05:28:19 +00:00
kernel Add missing nullptr check in QWidget::setFocusProxy 2023-04-25 04:26:10 +02:00
styles Implement color role AccentColor in QStyleSheetStyle and QCssParser 2023-05-22 14:45:26 +00:00
util QCompleter::setPopup() - refactor and cleanup 2023-03-14 21:15:31 +01:00
widgets QMenu: don't crash when nested tear-off menus are closed 2023-06-09 00:08:36 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00