qt6-bb10/examples/widgets/painting/shared
Volker Hilsheimer 9d8473cdf6 Examples: fix touch handling in painting examples
On macOS, we don't deliver a press event for the first press on the
track pad (Qt::WA_TouchPadAcceptSingleTouchEvents is not set by default,
so Qt doesn't deliver a single-press on the track pad as a touch event -
that makes some sense or at least maintains compatibility). Because of
that, point 0 is never added to the finger-mapping hash.

When point 0 is then released, we didn't check if we found a valid
iterator for that point ID, and the example crashed.

Fix this by checking that we have a valid iterator before dereferencing,
and by handling Stationary events in the same way as pressed (add the
point to the mapping if it's not already there).

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-110266
Change-Id: I32337b801aaabf9b821a97ddc15ad78747b5e6a2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-12-15 17:30:36 +01:00
..
images
CMakeLists.txt Examples: remove OpenGL code paths from painting examples 2023-10-27 16:22:59 +02:00
arthurstyle.cpp
arthurstyle.h
arthurwidgets.cpp Examples: remove OpenGL code paths from painting examples 2023-10-27 16:22:59 +02:00
arthurwidgets.h Examples: remove OpenGL code paths from painting examples 2023-10-27 16:22:59 +02:00
hoverpoints.cpp Examples: fix touch handling in painting examples 2023-12-15 17:30:36 +01:00
hoverpoints.h
shared.pri Examples: remove OpenGL code paths from painting examples 2023-10-27 16:22:59 +02:00
shared.qrc
use_lib.cmake Examples: remove OpenGL code paths from painting examples 2023-10-27 16:22:59 +02:00