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
godbo...@amotus.ca <mailto:godbo...@amotus.ca>

*dimonoff.com* <https://www.dimonoff.com/>| *amotus.ca* <https://www.amotus-solutions.com/>

*From:*Interest <interest-boun...@qt-project.org> *On Behalf Of *Alexander Dyagilev
*Sent:* February 15, 2021 12:14 PM
*To:* interest@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?

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to