I need to send a Mouse event to a QML object starting with QML. For instance,
Rectangle { id: rect MouseArea { anchors.fill: parent onClicked: console.log(mouse.x + ', ' + mouse.y) } Rectangle { x: 0; y: 0; width: 50; height: 50 color: 'red' onClicked: rect.click(randomX(), randomY()) // <---- HERE } }
I need a line that says HERE to trigger the click event for rect , which will be passed to MouseArea .
source share