I have a program written in Qt, who uses QML.
I’d like to know if it is possible to know the coordinates in real time during the drag of an element.
Actually, I use a custom image that replaces the cursor, its position is updated with the coordinates of the cursor (which is hidden).
I can actually recover the position of the mouse cursor during its deplacement with “onPositionChanged” or just after a click with “onClicked.”
I want also to know these coordinates during a drag, I tried with “onPressed” and “onPressAndHold” but without success, the position of the custom cursor is updated only on the click release.
Any help would be appreciated, thank you in advance.
Dragging elements changes the
xandyproperties directly so you can monitor those: