summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/textdocument-end/textdocumentendsnippet.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2025-07-23 22:58:45 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2025-08-01 01:14:13 +0200
commit646cef5a86a3e1b47bdb6d719202a8a3ccaa0296 (patch)
tree009bc34c475026bfec8c4437412af66a513022c5 /src/gui/doc/snippets/textdocument-end/textdocumentendsnippet.cpp
parent66cc853035dfbbed213657511d6653adbd85bcdf (diff)
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>
Diffstat (limited to 'src/gui/doc/snippets/textdocument-end/textdocumentendsnippet.cpp')
0 files changed, 0 insertions, 0 deletions