Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi, I have a mouseArea:
MouseArea { id: myMouseArea }
How I can set onClicked action for myMouseArea outside this element? I want to set onClicked action dynamically for myMouseArea e.g. in Component.onCompleted section of my qml file.
hi @MartinD ,
You can use connect() fucntion
function fnc(){ console.log("click") } Component.onCompleted:{ ms.clicked.connect(fnc) } Rectangle{ height: 90 width: 90 color: "grey" anchors.centerIn: parent MouseArea{ id:ms anchors.fill: parent } }