qt6-bb10/examples/widgets
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
..
animation Examples: Remove unnecessary Q_INIT_RESOURCE calls 2023-06-08 16:15:02 +00:00
desktop Doc: Add example categories to Qt Widget examples 2023-09-05 07:47:49 +03:00
dialogs standarddialogs: Don't assume QMessageBox::exec() returns clicked role 2023-10-24 22:30:03 +02:00
doc Turn the "concentriccircles" example into snippets, update screenshot 2023-12-14 20:06:32 +01:00
draganddrop examples: Update content of "draggabletext" 2023-12-13 16:21:55 +00:00
gallery Examples: Use PRIVATE CMake linkage 2022-11-30 14:48:50 +01:00
gestures Doc: Add example categories to Qt Widget examples 2023-09-05 07:47:49 +03:00
graphicsview Move graphis view flow layout example to manual test 2023-06-28 09:56:40 +02:00
itemviews SimpleTreeModel: Polish TreeModel::setupModelData() 2023-12-06 18:22:41 +01:00
layouts Move dynamic layouts example to manual test 2023-06-28 00:09:58 +02:00
mainwindows Move main window example to manual test 2023-06-29 14:49:13 +02:00
painting Examples: fix touch handling in painting examples 2023-12-15 17:30:36 +01:00
qnx/foreignwindows Doc: Fix license of foreignwindows example 2023-06-30 18:46:54 +02:00
rhi Enable QWidget::grab() with QRhiWidget in the widget tree 2023-08-28 21:14:28 +02:00
richtext Move textedit example to manual test 2023-06-29 14:49:13 +02:00
tools Fix the project name 2023-07-31 12:38:40 +02:00
touch Doc: Add example categories to Qt Widget examples 2023-09-05 07:47:49 +03:00
tutorials Doc: Add example categories to Qt Widget examples 2023-09-05 07:47:49 +03:00
widgets Refurbish the shaped clock example 2023-11-17 23:36:38 +01:00
CMakeLists.txt examples: Add new subdirectory to examples/widgets CMakeLists 2023-08-15 01:11:03 +02:00
widgets.pro Add QRhiWidget 2023-08-14 17:05:36 +02:00