summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-08-27 13:59:36 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-08-27 14:00:40 (GMT)
commit74dfe3e87c6a126e090a86b918f383e4bba9cb5a (patch)
tree912aa572c51a78d71b13867cf0edead4ff000eca /src/gui/kernel/qwidget_mac.mm
parent13ccfeb578f86709ce5cb17c2cde94a5320da379 (diff)
downloadQt-74dfe3e87c6a126e090a86b918f383e4bba9cb5a.zip
Qt-74dfe3e87c6a126e090a86b918f383e4bba9cb5a.tar.gz
Qt-74dfe3e87c6a126e090a86b918f383e4bba9cb5a.tar.bz2
Gestures: Implement swipe gesture
Note: if this fails building on any platform, talk to Denis!
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 192ae6b..cdf0706 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -1074,7 +1074,14 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event,
break;
}
qNGEvent.gestureType = QNativeGestureEvent::Swipe;
- qNGEvent.direction = QSize(-swipeDirection.x, -swipeDirection.y);
+ if (swipeDirection.x == 1)
+ qNGEvent.angle = 180.0f;
+ else if (swipeDirection.x == -1)
+ qNGEvent.angle = 0.0f;
+ else if (swipeDirection.y == 1)
+ qNGEvent.angle = 90.0f;
+ else if (swipeDirection.y == -1)
+ qNGEvent.angle = 270.0f;
break; }
case kEventGestureMagnify: {
CGFloat amount;