qt5base-lts/tests/auto/widgets/itemviews
Volker Hilsheimer 52f4d0b0d2 QAbstractItemDelegate: tolerate that editor gets reparented
An item delegate might override destroyEditor to merely reparent the
existing editor out of the item view for later reuse, rather than
actually destroying the editor.

As of d0dffdfc01, the code calling
closeEditor() - which calls destroyEditor - might explicitly set focus
back to the item view parent of the editor. This needs to handle that
the parent of the editor might no longer be valid after the closeEditor
call returns, and rather store the old parent widget explicitly.

Add a test case that segfaults with nullptr access without the fix.

Fixes: QTBUG-105231
Pick-to: 6.4 6.3 6.2
Change-Id: I04a355673823c4941865f7a575864e991ceeb5f0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-08-25 18:04:19 +02:00
..
qabstractitemview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qcolumnview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qdatawidgetmapper Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qfileiconprovider Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qheaderview QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO defines 2022-08-24 22:08:49 +02:00
qitemdelegate QAbstractItemDelegate: tolerate that editor gets reparented 2022-08-25 18:04:19 +02:00
qitemeditorfactory Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qitemview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qlistview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qlistwidget Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qtableview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qtablewidget Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qtreeview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qtreewidget Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qtreewidgetitemiterator Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00