import QtQuick 2.7 import QtQuick.Controls 1.4 Item { id: testRect property int count: 0 Rectangle { id: bgRect anchors.fill: parent color: "white" } TextArea { id: test anchors.fill: parent; readOnly: true menu: null backgroundVisible: false font.pixelSize: 12 text: "" } MouseArea { id: mouseArea anchors.fill: parent onClicked: { ++count; console.log(count + " onClicked"); test.insert(test.length, count + " onClicked\n"); bgRect.color = "blue" } onCanceled: { ++count; console.log(count + " onCanceled"); test.insert(test.length, count + " onCanceled\n"); bgRect.color = "magenta" } onEntered: { ++count; console.log(count + " onEntered"); test.insert(test.length, count + " onEntered\n"); bgRect.color = "green" } onExited: { ++count; console.log("onExited"); test.insert(test.length, count + " onExited\n"); bgRect.color = "yellow" } onPressed: { ++count; console.log(count + " onPressed"); test.insert(test.length, count + " onPressed\n"); bgRect.color = "cyan" } onReleased: { ++count; console.log(count + " onReleased"); test.insert(test.length, count + " onReleased\n"); bgRect.color = "red" } } }