diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-11-13 17:54:26 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-01-25 21:59:35 +0100 |
commit | d896d76b0f2ff0387cd09a04107ea5df087268e1 (patch) | |
tree | be6d7385188baa3a83c8e59b400baf4d7cae5984 /src/quick/items/qquickitem.cpp | |
parent | 817cd03a5f437c9e8862646cca5ea016b1223bc7 (diff) |
PinchArea: handle native gestures when available
PinchArea is the first Item where we handle a QNativeGestureEvent,
so QQuickWindowPrivate::deliverGestureEvent is added to deliver these
events in the same way as the other deliverXEvent methods.
For now there is not a separate virtual event handler in QQuickItem,
because QNativeGestureEvent is not universally available, so it's
necessary to handle this event type in QQuickPinchArea::event().
updatePinchTarget() contains code factored out from updatePinch()
to do the necessary tranformations on the Item which was set as
pinch.target in QML.
So far the QNativeGestureEvents are generated only on OSX, so
the behavior of the PinchArea on other platforms is unmodified.
On OSX the intention is that we do not need to enable multiple-touch
events in order to use any of the common 2-finger gestures, and the
"feel" will be similar to that of gestures in native applications.
[ChangeLog][QtQuick][PinchArea] Pinch gestures are recognized by
the operating system on OSX
Change-Id: I693526ea120a9144beb7666afeab6256caa73e51
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 38736e44b2..2d81714ee1 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -7316,6 +7316,9 @@ bool QQuickItem::event(QEvent *ev) dropEvent(static_cast<QDropEvent*>(ev)); break; #endif // QT_NO_DRAGANDDROP + case QEvent::NativeGesture: + ev->ignore(); + break; default: return QObject::event(ev); } |