diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-01-08 11:20:19 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-17 10:48:38 +0100 |
commit | 2833556a079defdb27c3dbe117ab66ea8080de75 (patch) | |
tree | 82bf4af1c93f86b7d969d245ff8846952acb8f25 /src/quick/items/qquickmultipointtoucharea_p.h | |
parent | 6ccb9f8f04ea257520e518b25999907c6a8421e1 (diff) |
Improve Mac OS X touch event enabling.
Previously, the Qt Quick touch interaction items would
enable touch events on window change. On app startup
this would typically happen before the platform window
was created, and the call to registerTouchWindow would
then create the platform window.
registerTouchWindow in QtBase has now been changed
to not create the platform window since this has
unwanted side effects. Calling it at window change
time will then have no effect for the initial window
change.
Enable and disable touch events on hoverEnter/Leave
instead. This is similar to what QtWidgets does and
has an additional benefit: touch events can now be
enabled when the mouse cursor is hovering over a touch
item, reducing the chances of it interfering with
scroll events for other items.
Task-number: QTBUG-32988
Change-Id: Ic48dbec910f52299d5068f5ca7508be73cdc6f36
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/quick/items/qquickmultipointtoucharea_p.h')
-rw-r--r-- | src/quick/items/qquickmultipointtoucharea_p.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h index 2e1f2a98fb..83cc407401 100644 --- a/src/quick/items/qquickmultipointtoucharea_p.h +++ b/src/quick/items/qquickmultipointtoucharea_p.h @@ -250,9 +250,11 @@ protected: bool shouldFilter(QEvent *event); void grabGesture(); virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *); - -protected Q_SLOTS: - void setTouchEventsEnabledForWindow(QWindow *window); +#ifdef Q_OS_OSX + void hoverEnterEvent(QHoverEvent *event); + void hoverLeaveEvent(QHoverEvent *event); + void setTouchEventsEnabled(bool enable); +#endif private: void ungrab(); @@ -261,7 +263,6 @@ private: QList<QObject*> _releasedTouchPoints; QList<QObject*> _pressedTouchPoints; QList<QObject*> _movedTouchPoints; - QWindow *_currentWindow; int _minimumTouchPoints; int _maximumTouchPoints; bool _stealMouse; |