1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import QtQuick 2.4 Item { width: 500 height: 500 Rectangle { width: 300 height: 300 color: mouseArea.containsPress ? "red" : "grey" x: 100 y: 100 MouseArea { id: mouseArea objectName: "mouseArea" anchors.fill: parent } } }