diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-14 15:18:44 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-25 15:48:01 +0000 |
commit | 6c8d844eb57a95b3ca6b802a76d9db927051229f (patch) | |
tree | 0611ca744fbb39b814c3d8c565e628d5c1b3f595 /src/quick/handlers/qquickmultipointhandler_p.h | |
parent | 961b20eee85d81a0afa2ae08d02456a36d2325e9 (diff) |
MultiPointHandler::hasCurrentPoints: OK if event has more points
We plan for DragHandler to be able to handle multiple points and thus
to inherit from MultiPointHandler. But most DragHandlers only handle
single points. Without this change, the mixer manual test would be
broken: each DragHandler's m_currentPoints will have only one point,
but as soon as the event has multiple points, all the DragHandlers
would return false from wantsPointerEvent, and therefore it becomes
impossible to drag two DragHandlers with two fingers.
This test was just meant as a shortcut/optimization anyway.
But if the event contains fewer points than the handler already knows
that it wants to handle, we can still return early.
Change-Id: Ieea26a09bb9af9ee3c7ff2913f8e90f35c0f070e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickmultipointhandler_p.h')
-rw-r--r-- | src/quick/handlers/qquickmultipointhandler_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickmultipointhandler_p.h b/src/quick/handlers/qquickmultipointhandler_p.h index 5a44866e67..ddcf731227 100644 --- a/src/quick/handlers/qquickmultipointhandler_p.h +++ b/src/quick/handlers/qquickmultipointhandler_p.h @@ -98,7 +98,7 @@ protected: bool wantsPointerEvent(QQuickPointerEvent *event) override; void handlePointerEventImpl(QQuickPointerEvent *event) override; void onActiveChanged() override; - bool sameAsCurrentPoints(QQuickPointerEvent *event); + bool hasCurrentPoints(QQuickPointerEvent *event); QVector<QQuickEventPoint *> eligiblePoints(QQuickPointerEvent *event); qreal averageTouchPointDistance(const QPointF &ref); qreal averageStartingDistance(const QPointF &ref); |