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-24 16:19:18 +0100 |
commit | 68c103225f4e8bd6c1b18ef547108fd60f398c0f (patch) | |
tree | 92ab9f5c399f7473a7c65d1062db20d0761f5a5a /src/quick/items/qquickitem_p.h | |
parent | cccef3886fc50df5e0b39540885e3b5518ece2b1 (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>
Diffstat (limited to 'src/quick/items/qquickitem_p.h')
-rw-r--r-- | src/quick/items/qquickitem_p.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index b97b9cefd5..caa6edb15b 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -388,6 +388,8 @@ public: QSGOpacityNode *opacityNode; QQuickDefaultClipNode *clipNode; QSGRootNode *rootNode; + // subsceneDeliveryAgent is set only if this item is the root of a subscene, not on all items within. + QQuickDeliveryAgent *subsceneDeliveryAgent = nullptr; // Mask contains() method QMetaMethod maskContains; @@ -480,6 +482,8 @@ public: bool replayingPressEvent:1; bool touchEnabled:1; bool hasCursorHandler:1; + // set true when this item expects events via a subscene delivery agent; false otherwise + bool hasSubsceneDeliveryAgent:1; enum DirtyType { TransformOrigin = 0x00000001, @@ -607,6 +611,10 @@ public: qreal startScale, qreal activeScale, qreal startRotation, qreal activeRotation); + QQuickDeliveryAgent *deliveryAgent(); + QQuickDeliveryAgentPrivate *deliveryAgentPrivate(); + QQuickDeliveryAgent *ensureSubsceneDeliveryAgent(); + void deliverKeyEvent(QKeyEvent *); bool filterKeyEvent(QKeyEvent *, bool post); #if QT_CONFIG(im) |