Skip to content

Commit

Permalink
QQuickFlickable: Send synthetic release event through QCoreApplication
Browse files Browse the repository at this point in the history
As we do this with the press event, we have to do the same with the
release event. The application tracks the state of mouse buttons and
will get confused if an additional press event without symmetric
release event shows up.

Change-Id: Ia27a96fa5b207ed8aaad913caf7575de112e8606
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
  • Loading branch information
ulherman authored and denexter committed Sep 15, 2015
1 parent c7cf17e commit 57f02f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/quick/items/qquickflickable.cpp
Expand Up @@ -1251,7 +1251,7 @@ void QQuickFlickable::mouseReleaseEvent(QMouseEvent *event)
if (window() && window()->mouseGrabberItem()) {
QPointF localPos = window()->mouseGrabberItem()->mapFromScene(event->windowPos());
QScopedPointer<QMouseEvent> mouseEvent(QQuickWindowPrivate::cloneMouseEvent(event, &localPos));
window()->sendEvent(window()->mouseGrabberItem(), mouseEvent.data());
QCoreApplication::sendEvent(window(), mouseEvent.data());
}

// And the event has been consumed
Expand Down

0 comments on commit 57f02f0

Please sign in to comment.