aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/items/qquickflickable.cpp16
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;
}
}