[Interest] QML MouseArea containsMouse is set to true even if it's not actually

Alexander Dyagilev alervdvcw at gmail.com
Wed Feb 24 15:51:22 CET 2021


Hello,

Thanks for the response. Unfortunately, this does not help much...


On 2/15/2021 8:41 PM, Jérôme Godbout wrote:
>
> Hi,
>
> Check if you can tweak the following property on your mouse area. 
> https://doc.qt.io/qt-5/qml-qtquick-mousearea.html#preventStealing-prop 
> <https://doc.qt.io/qt-5/qml-qtquick-mousearea.html#preventStealing-prop>
>
> ·*preventStealing 
> <https://doc.qt.io/qt-5/qml-qtquick-mousearea.html#preventStealing-prop>* : 
> bool
>
> ·*propagateComposedEvents 
> <https://doc.qt.io/qt-5/qml-qtquick-mousearea.html#propagateComposedEvents-prop>*
>
> You could also handle the mouse event of the mouse area and put the 
> accepted to false to avoid eating the event: 
> https://doc.qt.io/qt-5/qml-qtquick-mouseevent.html#accepted-prop 
> <https://doc.qt.io/qt-5/qml-qtquick-mouseevent.html#accepted-prop>
>
> Hope that help you find the proper behaviour are after.
>
> *Jérôme Godbout**
> *Software / Firmware Lead
> *
> **C:*(581) 777-0050
> *O:*(418) 800-1073 ext.: 109
> godbotuj at amotus.ca <mailto:godbotuj at amotus.ca>
>
> *dimonoff.com* <https://www.dimonoff.com/>| *amotus.ca* 
> <https://www.amotus-solutions.com/>
>
> *From:*Interest <interest-bounces at qt-project.org> *On Behalf Of 
> *Alexander Dyagilev
> *Sent:* February 15, 2021 12:14 PM
> *To:* interest at qt-project.org
> *Subject:* [Interest] QML MouseArea containsMouse is set to true even 
> if it's not actually
>
> Hello,
>
> In our code we have one MouseArea which fills entire parent:
>
> MouseArea{
>
> id:/mouseAreaRow/
> hoverEnabled:true
> anchors.fill:/parent/
> propagateComposedEvents:true
> onPressed:{/mouse/.accepted=false}
> }
>
> And we have another MouseArea which fills a small part of the same 
> area which the first MouseArea fills:
>
> MouseArea{
>
> id:/mouseAreaUp/
> hoverEnabled:true
> anchors.fill:/parent/
> cursorShape:/Qt/.PointingHandCursor
> }
>
> The problem is that sometimes mouseAreaUp.containsMouse continues to 
> be set to true even after the mouse left its area. Most of the time it 
> happens when the mouse pointer is moved very fast.
>
> Is this a known issue or maybe some misunderstanding on our side?
>
> Is there any workaround? Is it possible to at least force MouseArea to 
> recheck if it really contains the mouse pointer?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210224/3a603015/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7814 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210224/3a603015/attachment.png>


More information about the Interest mailing list