diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-07-14 20:09:57 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-02-25 10:31:37 +0100 |
commit | f35afe3eeaa460cb5e96171fb8a43fdf52c8761c (patch) | |
tree | 32b5c087a30a5dc455b8505415b0372c661f24cd /src/quick/items/qquickmousearea.cpp | |
parent | 4853b3a7d50c20ad00a2780b8d11a0f9c38462ae (diff) |
Move event delivery from QQWindow to QQuickDeliveryAgent
QQuickWindow owns QQuickRootItem which owns QQuickDeliveryAgent, so
for every window there's an object responsible for event delivery,
while the window itself is mainly responsible for rendering (separation
of concerns). However, QQuickRootItem and QQuickDeliveryAgent can now
be used in cases where the scene doesn't directly belong to a window,
such as when a Qt Quick sub-scene is mapped somewhere into a Qt Quick 3D
scene. In that case, we must remember which delivery agent was in use
at the time when a QEventPoint is grabbed and deliver subsequent updates
via the same DA. There's also a QQuickDeliveryAgent::Transform
abstraction which subscene-management code (such as QQuick3DViewport)
can implement, to provide a formula to map the window's scene
coordinates to subscene coordinates; if defined, it will be used
during delivery of subsequent updates to existing grabbers.
Task-number: QTBUG-84870
Change-Id: I70b433f7ebb05d2e60214ff3192e05da0aa84a42
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 68c103225f4e8bd6c1b18ef547108fd60f398c0f)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/quick/items/qquickmousearea.cpp')
-rw-r--r-- | src/quick/items/qquickmousearea.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index 037eddd6a8..1d4c707c76 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -752,10 +752,10 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event) d->lastPos = mapFromScene(d->lastScenePos); } - bool dragOverThresholdX = QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(), - Qt::XAxis, event, d->drag->threshold()); - bool dragOverThresholdY = QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), - Qt::YAxis, event, d->drag->threshold()); + bool dragOverThresholdX = QQuickDeliveryAgentPrivate::dragOverThreshold(dragPos.x() - startPos.x(), + Qt::XAxis, event, d->drag->threshold()); + bool dragOverThresholdY = QQuickDeliveryAgentPrivate::dragOverThreshold(dragPos.y() - startPos.y(), + Qt::YAxis, event, d->drag->threshold()); if (!d->overThreshold && (((targetPos.x() != boundedDragPos.x()) && dragOverThresholdX) || ((targetPos.y() != boundedDragPos.y()) && dragOverThresholdY))) |