Marc Mutz c0dbfe6c87 tst_QGraphicsItem: properly init QGraphicsSceneDragDropEvent
Nothing was setting its proposedAction() and dropAction(), but they
were read in QGraphicsScenePrivate::cloneDragDropEvent(), leading
UBSan to complain about reading an invalid value for that
enum. Interestingly, Valgrind didn't find this issue, probably because
of the strong security options we're now activating by default for a
Qt build (stack protector, trivial-auto-var init, ...).

Says UBSan (excerpt):

  qgraphicssceneevent.cpp:1591:15: runtime error: load of value 3200171710, which is not a valid value for type 'DropAction'

To fix, explicitly set the two properties on the locally-created
QGraphicsSceneDragDropEvent. I didn't go the way of "fixing" this by
initializing the members in QGraphicsScenePrivate, because the rest of
the test doesn't trigger any other error, so Qt itself is
well-behaved, and proactively initializing stuff prevent tools from
noticing inconsistencies.

Amends the start of the public history.

Pick-to: 6.9 6.8 6.5 5.15
Change-Id: Ibc9663e8afcd1f7ff9d0e3c646f70e0ceded67a9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2025-03-28 06:55:06 +00:00
2025-03-24 19:01:57 +02:00
2024-11-05 14:36:16 +01:00
2024-11-05 14:36:16 +01:00
2024-12-13 14:54:23 +00:00
2025-03-24 23:19:04 +01: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%