diff options
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index b9fb0721b3..6333bf704a 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2028,7 +2028,7 @@ void QQuickWindowPrivate::deliverTouchEvent(QTouchEvent *event) } } -void QQuickWindowPrivate::flushDelayedTouchEvent() +void QQuickWindowPrivate::flushFrameSynchronousEvents() { if (delayedTouch) { deliverDelayedTouchEvent(); @@ -2039,6 +2039,17 @@ void QQuickWindowPrivate::flushDelayedTouchEvent() if (ut && ut->hasStartAnimationPending()) ut->startAnimations(); } + + // Once per frame, send a synthetic hover, in case items have changed position. + // For instance, during animation (including the case of a ListView + // whose delegates contain MouseAreas), a MouseArea needs to know + // whether it has moved into a position where it is now under the cursor. + if (!mouseGrabberItem && !lastMousePosition.isNull()) { + bool accepted = false; + bool delivered = deliverHoverEvent(contentItem, lastMousePosition, lastMousePosition, QGuiApplication::keyboardModifiers(), accepted); + if (!delivered) + clearHover(); // take care of any exits + } } void QQuickWindowPrivate::reallyDeliverTouchEvent(QTouchEvent *event) |