diff options
author | Filippo Cucchetto <f.cucchetto@asem.it> | 2016-04-14 10:48:25 +0200 |
---|---|---|
committer | Filippo Cucchetto <filippocucchetto@gmail.com> | 2016-04-19 16:12:17 +0000 |
commit | e1400b5b4d8311769ad3b9f631479ee2b0271197 (patch) | |
tree | 7ec3196d596f72c81aa48110d7977df83dfa3016 /src/quick/items/qquickmousearea_p_p.h | |
parent | fc22938dfc7b4c09f76913ac62e1f8ba345eccaf (diff) |
Fixed MouseArea threshold with preventStealing
When preventStealing is true both keepMouseGrab() and
d->stealMouse are true. This in turn enable the dragging immediately
since the condition "keepMouseGrab() && d->stealMouse && !d->drag->active()"
is true.
Conversely when preventStealing is false the dragging is enabled in the
next move event since keepMouseGrab() and d->stealMouse are set true
inside the last "if" "!keepMouseGrab() && ...check threshold..".
This patch adds a new boolean flag for storing if we detected a drag motion
(so we exceeded the threshold) and enable the dragging iff this flag is true.
With this change:
- if preventStealing is true (and so keepMouseGrab() and d->stealMouse) the
additional d->overThresHold prevent the start of dragging. At the same time
the last if (!keepMouseGrab()) cannot be executed since keepMouseGrab is true
and we still check for the threshold being exceeded.
- if preventStealing is false, we still check for exceeding the threshold and
if this happen we enter in the last "if" since !keepMousegrab() && d->overThreshold
is true taking the mouseGrab as without this patch
Task-number: QTBUG-52534
Change-Id: I2b14d3048b6f8223c90ce5e2fd26e7ca706cb56a
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickmousearea_p_p.h')
-rw-r--r-- | src/quick/items/qquickmousearea_p_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h index 014729b651..f63c5f6092 100644 --- a/src/quick/items/qquickmousearea_p_p.h +++ b/src/quick/items/qquickmousearea_p_p.h @@ -86,6 +86,7 @@ public: bool doubleClick : 1; bool preventStealing : 1; bool propagateComposedEvents : 1; + bool overThreshold : 1; Qt::MouseButtons pressed; #ifndef QT_NO_DRAGANDDROP QQuickDrag *drag; |