diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-09-01 06:16:18 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-02-02 19:17:35 +0000 |
commit | e2fd141372335f917c2d216051abb00d8b15f87c (patch) | |
tree | 8521c470e66d1a1badeb3c3020774abc66d639f7 /src/quick/items/qquickevents_p_p.h | |
parent | 73e9dc0667935b7b403c10736775d24d6e22eb8c (diff) |
QQuickWindow: deliver updates to handlers even if they don't grab
The "weak grab" concept depends on this.
First we deliver to grabbers, then we deliver to non-grabbing handlers
(but not to non-grabbing items). Avoid re-delivering to grabbing
handlers which already received the same event.
Change-Id: If51e1cd9372e3bed1daea3758e9ef8e37c0ba5e3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents_p_p.h')
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 4a78e98705..bbfc34dacf 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -393,6 +393,7 @@ public: // helpers for C++ only (during event delivery) virtual const QQuickPointerTabletEvent *asPointerTabletEvent() const { return nullptr; } bool isValid() const { return m_event != nullptr; } virtual bool allPointsAccepted() const = 0; + virtual bool allPointsGrabbed() const = 0; bool isAccepted() { return m_event->isAccepted(); } void setAccepted(bool accepted) { m_event->setAccepted(accepted); } QVector<QPointF> unacceptedPressedPointScenePositions() const; @@ -402,6 +403,7 @@ public: // helpers for C++ only (during event delivery) virtual QQuickEventPoint *pointById(quint64 pointId) const = 0; virtual QVector<QObject *> grabbers() const = 0; virtual void clearGrabbers() const = 0; + virtual bool hasGrabber(const QQuickPointerHandler *handler) const = 0; ulong timestamp() const { return m_event->timestamp(); } @@ -430,8 +432,10 @@ public: QQuickEventPoint *point(int i) const override; QQuickEventPoint *pointById(quint64 pointId) const override; bool allPointsAccepted() const override; + bool allPointsGrabbed() const override; QVector<QObject *> grabbers() const override; void clearGrabbers() const override; + bool hasGrabber(const QQuickPointerHandler *handler) const override; QMouseEvent *asMouseEvent(const QPointF& localPos) const; @@ -461,8 +465,10 @@ public: QQuickEventPoint *pointById(quint64 pointId) const override; const QTouchEvent::TouchPoint *touchPointById(int pointId) const; bool allPointsAccepted() const override; + bool allPointsGrabbed() const override; QVector<QObject *> grabbers() const override; void clearGrabbers() const override; + bool hasGrabber(const QQuickPointerHandler *handler) const override; QMouseEvent *syntheticMouseEvent(int pointID, QQuickItem *relativeTo) const; QTouchEvent *touchEventForItem(QQuickItem *item, bool isFiltering = false) const; |