qtbase/examples/widgets
Shawn Rutledge 646cef5a86 ImageGestures example: decide direction based on swipeAngle
swipeTriggered() often chose the wrong direction, because the logic
was allowing either vertical or horizontal decisions to override each
other: if you swipe to the right, but also a little upwards for example,
"up" overrode "right" and you would go back instead of forward.
It worked only if you made an effort to swipe both down and right to
go forwards, and both up and left to go back.

The docs are not wrong at least: horizontalDirection or
verticalDirection is set to NoDirection only in the case that the angle
doesn't have "a horizontal component" or "a vertical component",
respectively (assuming that's even possible). So those enum properties
are only useful if you want to detect swiping on only one axis.

Instead, we now check which side of a 45 degree line the angle is on.

Pick-to: 6.10 6.9 6.8 6.5
Task-number: QTBUG-37759
Task-number: QTBUG-46195
Change-Id: Ibd78071dc78ccaa13d63200e26a614b7017a9b1b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-08-01 01:14:13 +02:00
..
animation Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
desktop systray example: if there is no system tray, allow waiting for one 2024-06-05 01:40:10 +00:00
dialogs Standard dialogs example: Fix compilation with QT_NO_CAST_FROM_ASCII 2025-01-21 07:46:39 +01:00
doc Replace treemodel-structure.png with an svg in simpletreemodel.qdoc 2025-07-10 20:38:18 +02:00
draganddrop Examples: fix a couple of nodiscard warnings from QFile::open 2025-04-24 10:44:03 +01:00
gallery Do not lie about keyboard shortcut to macOS users 2025-02-03 13:01:39 +01:00
gestures ImageGestures example: decide direction based on swipeAngle 2025-08-01 01:14:13 +02:00
graphicsview Replace qdebug.h includes in public headers with forward-declarations 2025-01-15 13:28:16 +02:00
itemviews examples: check return value of QFile::open() calls 2025-01-22 19:53:25 +02:00
layouts CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
mainwindows CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
painting Use QPainterStateGuard in examples 2024-12-17 19:59:01 +01:00
qnx/foreignwindows
rhi Add missing qquaternion.h includes 2025-06-30 19:45:40 +02:00
richtext CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
tools Show Custom Completer example as part of UI Components category 2024-10-31 17:36:09 +02:00
touch CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
tutorials Notepad example: Use theme icons 2025-01-28 20:35:19 +01:00
widgets Make the windowflags example use "normal" windows 2025-06-25 19:55:50 +02:00
CMakeLists.txt Correct license for examples files 2024-03-07 11:06:43 +01:00
widgets.pro