import QtQuick 2.1 Column { anchors.fill: parent Rectangle { color: "#ffeeee" height: parent.height / 2 anchors.left: parent.left anchors.right: parent.right Text { anchors.centerIn: parent font.pixelSize: 16 text: "update()" } MouseArea { anchors.fill: parent onClicked: { update(); parent.color = "#99ff99"; } } } Rectangle { color: "#eeffee" height: parent.height / 2 anchors.left: parent.left anchors.right: parent.right Text { anchors.centerIn: parent font.pixelSize: 16 text: "updateBla()" } MouseArea { anchors.fill: parent onClicked: { updateBla(); parent.color = "#99ff99"; } } } function updateBla() { console.log("WORKS!"); } function update() { console.log("KABOOM!"); } }