[Interest] Track global mouse position in QML

René Hansen renehh at gmail.com
Thu Mar 21 12:50:02 CET 2019


Hi all,


I want to track mouse movement within my entire application window, because
I need to show/hide/move items around where my cursor is at certain times.
(Think e.g. custom cursor)

I can do it easily by filling the entire window with a *MouseArea* and
handle *onPositionChanged*. The problem is that any mouse sensitive inputs
underneath, then get's blocked by the overlaying *MouseArea*. E.g. a
*TextField* that is usually highlighted on hover and clickable, no longer
receives any mouse events.

Is there any straightforward solution to this?

I know *QQuickWindow* has a *mouseMoveEvent*, but that doesn't seem to be
exposed in QML and if I can avoid subclassing and exposing a custom class,
I'd rather do that.


Cheers,

René Hansen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190321/3e396796/attachment.html>


More information about the Interest mailing list