summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_win.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-05 16:57:25 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-10 12:21:44 (GMT)
commit6826490774d66e0470fc1e5848ab89b3a0d0bb86 (patch)
tree553656766c1625ca837e3d07f59f77e6f3461ace /src/gui/kernel/qapplication_win.cpp
parent47f58dfad1eb7fe61a523597023df33f3d320377 (diff)
downloadQt-6826490774d66e0470fc1e5848ab89b3a0d0bb86.zip
Qt-6826490774d66e0470fc1e5848ab89b3a0d0bb86.tar.gz
Qt-6826490774d66e0470fc1e5848ab89b3a0d0bb86.tar.bz2
Implemented QPinchGesture.
Added a new standard gesture, which is implemented using a native zoom and rotate gestures on Windows and with a direct touch event handling on other platforms. Improved pan support - we subscribe to native pan gesture only when it's really needed, and we pass proper flags for single finger horizontal/vertical panning. Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/kernel/qapplication_win.cpp')
-rw-r--r--src/gui/kernel/qapplication_win.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index bdee6ec..cb67409 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3721,17 +3721,18 @@ bool QETWidget::translateGestureEvent(const MSG &msg)
QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal();
BOOL bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi);
+ if (bResult) {
+ const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
+ QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
+ if (alienWidget && alienWidget->internalWinId())
+ alienWidget = 0;
+ QWidget *widget = alienWidget ? alienWidget : this;
- const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
- QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
- if (alienWidget && alienWidget->internalWinId())
- alienWidget = 0;
- QWidget *widget = alienWidget ? alienWidget : this;
+ QNativeGestureEvent event;
+ event.sequenceId = gi.dwSequenceID;
+ event.position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
+ event.argument = gi.ullArguments;
- QNativeGestureEvent event;
- event.sequenceId = gi.dwSequenceID;
- event.position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
- if (bResult) {
switch (gi.dwID) {
case GID_BEGIN:
event.gestureType = QNativeGestureEvent::GestureBegin;
@@ -3746,6 +3747,8 @@ bool QETWidget::translateGestureEvent(const MSG &msg)
event.gestureType = QNativeGestureEvent::Pan;
break;
case GID_ROTATE:
+ event.gestureType = QNativeGestureEvent::Rotate;
+ break;
case GID_TWOFINGERTAP:
case GID_ROLLOVER:
default: