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/qquickpincharea_p.h | |
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/qquickpincharea_p.h')
-rw-r--r-- | src/quick/items/qquickpincharea_p.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/quick/items/qquickpincharea_p.h b/src/quick/items/qquickpincharea_p.h index 28db59fb55..21282237b7 100644 --- a/src/quick/items/qquickpincharea_p.h +++ b/src/quick/items/qquickpincharea_p.h @@ -274,15 +274,12 @@ protected: void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; void itemChange(ItemChange change, const ItemChangeData& value) Q_DECL_OVERRIDE; -#ifdef Q_OS_OSX - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void setTouchEventsEnabled(bool enable); -#endif + bool event(QEvent *) Q_DECL_OVERRIDE; private: void clearPinch(); void updatePinch(); + void updatePinchTarget(); void handlePress(); void handleRelease(); |