// First row of 10, consists of rectangle, mouse and label Row { id: row; anchors.horizontalCenter: parent.horizontalCenter; spacing: 45 Rectangle { id: brightUp; width: 80; height: 80; radius: 40; color: "white" MouseArea { id: mouse anchors.fill: brightUp onClicked: { getData() function getData(url) { var xhttp = new XMLHttpRequest() xhttp.onreadystatechange = function(myxhttp) { if (xhttp.readyState == 4 && xhttp.status == 200) { led.opacity = 1.0 timer.start() } return function() { if(myxhttp.readyState === 4) callback(myxhttp) } } xhttp.open("GET", "http://192.168.4.1/ir?code=16726725") xhttp.send('') } } // Stop/start the repeater onPressed: { console.log("Repeat triggered") pressTimer.start() } // This timer is purely to time the flashing of a virtual LED on my app's UI Timer { id: timer interval: 50 repeat: true running: false onTriggered: { led.opacity = 0.0 } } // This timer is for repeating a held mouse click Timer { id: pressTimer interval: 200 running: mouse.pressed repeat: true onTriggered: { timer.start() mouse.clicked(mouse) console.log("Repeat started") } } // Other stuff . . .