diff options
author | Martin Jones <martin.jones@jollamobile.com> | 2014-07-02 02:12:05 +0000 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-07-02 11:44:41 +0200 |
commit | f5adbaa903d5ac078dc71d5af555ba7884645a8f (patch) | |
tree | e4a84993da4146125f3387ae6c1cb4a7dc7c2cc3 | |
parent | 87a5889029aed8c53a4b02a42804d036614db36b (diff) |
Fix crash in Flickable with pressDelay.
Looks like this was exposed by the touch event compression change.
Task-number: QTBUG-40000
Change-Id: I037c848e0c5d766857dff3162c244213aba847da
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index d1bad78d41..d12a7554bb 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -1374,15 +1374,15 @@ void QQuickFlickablePrivate::replayDelayedPress() delayedPressTimer.stop(); // If we have the grab, release before delivering the event - QQuickWindow *w = q->window(); - if (w && (w->mouseGrabberItem() == q)) { - q->ungrabMouse(); + if (QQuickWindow *w = q->window()) { + if (w->mouseGrabberItem() == q) + q->ungrabMouse(); + + // Use the event handler that will take care of finding the proper item to propagate the event + replayingPressEvent = true; + QQuickWindowPrivate::get(w)->deliverMouseEvent(mouseEvent.data()); + replayingPressEvent = false; } - - // Use the event handler that will take care of finding the proper item to propagate the event - replayingPressEvent = true; - QQuickWindowPrivate::get(w)->deliverMouseEvent(mouseEvent.data()); - replayingPressEvent = false; } } |