diff options
author | Robin Burchell <robin.burchell@theqtcompany.com> | 2015-10-14 20:58:21 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-05-26 17:37:41 +0000 |
commit | 6f84a09dfbd15aac023580cf06e7b8c24f3b524c (patch) | |
tree | eb34fd782c151b6d9c1254428efd96353c44b255 /src/quick/scenegraph | |
parent | 0ac9389dbd7facaa424dc175e5f5dac514630eef (diff) |
QQuickWindow: Process a synthetic hover once per frame
This removes the limitation that hover only changes when the mouse moves, and
(in my opinion) is required to make hover functionality even remotely useful.
QtQuick scenes are a dynamic medium, items can move (or change) frequently, so
only changing this in response to a user action means it will frequently end up
out of date.
A very simple example of this is a ListView of delegates that each have a
background set on hover: when flicking the list, it won't reset the hover to
actually match the item under the mouse.
This is now not a (very) expensive operation to do, as deliverHoverEvent
does nothing if the item tree in question doesn't have hover enabled.
[ChangeLog][QtQuick][MouseArea] Hover state is now updated once per frame.
This means that MouseArea::containsMouse property will now be correct even
if the mouse is not moving, but items move under the cursor. Likewise
the mouse position properties and positionChanged signal will act as if
the mouse had moved.
Task-number: QTBUG-40475
Task-number: QTBUG-42194
Task-number: QTBUG-33982
Task-number: QTBUG-42578
Task-number: QTBUG-52537
Change-Id: Ic2dcbb45339e11c07f5c6a9c95eb7f64957968eb
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgwindowsrenderloop.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 1b0b1acc0e..fbb0fbb98a 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -371,7 +371,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) return; if (!data.grabOnly) { - cd->flushDelayedTouchEvent(); + cd->flushFrameSynchronousEvents(); // Event delivery/processing triggered the window to be deleted or stop rendering. if (!m_windows.contains(window)) return; diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 7c3405b715..aa27804a1e 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -1141,7 +1141,7 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose) } // Flush pending touch events. - QQuickWindowPrivate::get(window)->flushDelayedTouchEvent(); + QQuickWindowPrivate::get(window)->flushFrameSynchronousEvents(); // The delivery of the event might have caused the window to stop rendering w = windowFor(m_windows, window); if (!w || !w->thread || !w->thread->window) { diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 901fbbec43..1a0ab23a72 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -434,7 +434,7 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window) } } - d->flushDelayedTouchEvent(); + d->flushFrameSynchronousEvents(); // Event delivery or processing has caused the window to stop rendering. if (!windowData(window)) return; |