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/qquickpointerhandler.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/qquickpointerhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickpointerhandler.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index d51835a24b..ed08eed93e 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -140,9 +140,7 @@ QQuickItem *QQuickPointerHandler::target() const void QQuickPointerHandler::handlePointerEvent(QQuickPointerEvent *event) { - const bool wants = wantsPointerEvent(event); - setActive(wants); - if (wants) + if (wantsPointerEvent(event)) handlePointerEventImpl(event); else setActive(false); |