qt5base-lts/tests/auto/widgets
Volker Hilsheimer 2e12479e06 QGraphicsScene: respect that items can override selection changes
QGraphicsItems may override itemChange to prevent certain attribute
changes. Overriding ItemSelectedChange this way is explicitly documented
to be allowed.

However QGraphicsScene::clearSelection did not test whether items were
in fact deselected after the call to setSelection, and always cleared
the stored set of selected items.

Fix this by checking the actual selected state of the item as we iterate
over them, and store those items that are still selected in a set that
becomes the new selectedItems set (which will be empty if no item
overrides, which is the default).

Add a test that also checks that clearing the selection emits the
selectionChanged signal correctly (and does not if all selected items
block being deselected).

Fixes: QTBUG-85474
Pick-to: 6.4 6.3 6.2
Change-Id: I665afc132876e02e6e1061b7be37f4f6e4be418f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-06-20 20:44:23 +02:00
..
dialogs Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
effects Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
graphicsview QGraphicsScene: respect that items can override selection changes 2022-06-20 20:44:23 +02:00
itemviews Fix memory leak in tst_qtreewidget 2022-05-18 10:58:05 +00:00
kernel BLACKLIST tst_QApplication::sendEventsOnProcessEvents for Ubuntu 22.04 2022-06-20 20:06:20 +03:00
styles Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
util Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
widgets BLACKLIST tst_QMenuBar::check_menuPosition for Ubuntu 22.04 2022-06-20 20:06:20 +03:00
CMakeLists.txt Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00