diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-12-08 19:19:04 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-12-29 10:52:31 +0000 |
commit | 871314ced803afe0ac31033cfbd79fa4c1b18e3d (patch) | |
tree | 290bab4f0161c0880c1d7af8e68fd13b4ff42cee /src/quick/handlers/qquickpinchhandler.cpp | |
parent | 70113ef66b245e58ce12e2a9d26268e2eaeb3a42 (diff) |
DragHandler active property replaces dragging; same as grabbing
If a QQuickPointerSingleHandler grabs a point, it's definitely in the
active state: doing something with the point. (The converse is not
always true though: e.g. TapHandler can sometimes detect a tap without
ever grabbing.)
In DragHandler, the "dragging" property means the same as "active":
we always grab when dragging, to be sure to get the updates. So the
"dragging" property is removed because it's redundant.
In QQuickPointerHandler we don't say that "wanting" an event is the
same as being active, because 1) it won't necessarily grab right away
and 2) every handler which was active should "want" the release event,
yet it needs to setActive(false) as soon as it's done processing it.
Change-Id: Ie010db54714a7914109da6469e79865f9a0a18e4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpinchhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickpinchhandler.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index 45d8235dff..4832d300c2 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -224,6 +224,10 @@ void QQuickPinchHandler::onActiveChanged() void QQuickPinchHandler::handlePointerEventImpl(QQuickPointerEvent *event) { Q_UNUSED(event) + // TODO wait for the drag threshold before setting active + // but the old behavior was that whenever we "want" all the points, we're active + // so that behavior is retained here temporarily + setActive(m_currentPoints.count() > 0 && m_currentPoints.at(0)->state() != QQuickEventPoint::Released); if (Q_UNLIKELY(lcPinchHandler().isDebugEnabled())) { for (QQuickEventPoint *point : qAsConst(m_currentPoints)) |