diff options
author | Richard Moe Gustavsen <[email protected]> | 2022-09-16 13:13:00 +0200 |
---|---|---|
committer | Shawn Rutledge <[email protected]> | 2022-09-21 07:50:10 +0200 |
commit | 750fe797e15ced94d222dae0b3ec333e121ad8be (patch) | |
tree | 25d7cce45f270db2f3cf9344272bccb8e1079664 /src/quick/items/qquickmousearea_p_p.h | |
parent | a7c8bd27e390db9d0d401f9008ceb4130da53d6f (diff) |
QQuickMouseArea: store hoverEnabled explicitly
The current implementation would not explicitly store if
hoverEnabled was set. Instead it would use acceptHoverEvents()
directly. The problem is that the latter will also need to be
set to false when a MouseArea is disabled, otherwise it will not
receive a HoverLeave event. But when doing so, we will no longer
know if hoverEnabled was set to true or false by setEnabled() or
by setHoverEnabled(). As such, when the MouseArea is enabled again,
we would no longer know if we should start to subscribe to hover
events or not.
This patch will therefore add en extra bool, hoverEnabled,
that lets us track the hoverEnabled state explicitly.
As a drive-by, also add some internal docs that explains
how a MouseArea differs wrt hover compared to e.g
HoverHandlers and other items.
Fixes: QTBUG-46460
Pick-to: 6.4
Change-Id: I34e078b3574030572bcf770750820959e98ecc4c
Reviewed-by: Shawn Rutledge <[email protected]>
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 25287671a2..ede16e110b 100644 --- a/src/quick/items/qquickmousearea_p_p.h +++ b/src/quick/items/qquickmousearea_p_p.h @@ -51,6 +51,7 @@ public: #endif bool enabled : 1; + bool hoverEnabled : 1; bool scrollGestureEnabled : 1; bool hovered : 1; bool longPress : 1; |