qtbase/examples
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
..
aggregate
corelib Compile androidnotifier only if widgets are available 2025-05-02 16:51:15 +03:00
dbus Doc: Qt D-Bus: Add image alt texts 2025-04-09 13:15:35 +00:00
gui CMake: Fix examples built as external projects 2025-01-27 23:02:02 +01:00
network Doc: Add alt-text for Qt Network examples 2025-04-29 22:54:13 +02:00
opengl Add Qt::Orientations based flip and flipped functions 2024-11-29 15:07:14 +01:00
qmake examples: port qmake examples to new connection style 2022-12-21 22:52:17 +02:00
qtconcurrent Examples: include what you use (QElapsedTimer) 2025-03-26 02:04:43 +01:00
qtestlib CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
sql Doc: Add Alt-text to the Qt SQL examples 2025-04-09 07:15:08 +02:00
vulkan Examples: Disable QtC junction points for examples using 'shared' directory 2024-11-26 15:20:41 +02:00
widgets ImageGestures example: decide direction based on swipeAngle 2025-08-01 01:14:13 +02:00
xml Replace qdebug.h includes in public headers with forward-declarations 2025-01-15 13:28:16 +02:00
CMakeLists.txt CMake: Allow building all examples as standalone just like tests 2024-03-14 11:44:16 +01:00
README
examples.pro Remove undocumented embedded examples 2023-11-17 19:39:33 +01:00

README

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.