import QtQuick 2.0 Item { width: 200; height: 200 Rectangle { x: 75; y: 75 width: 100; height: 100 color: dropArea1.containsDrag ? "green" : "blue" border.color: mouseArea1.containsMouse ? 'black' : 'grey' border.width: 4 DropArea { id: dropArea1 anchors.fill: parent } MouseArea { id: mouseArea1 anchors.fill: parent hoverEnabled: true } } Rectangle{ x: 100; y: 100 width: 50; height: 50 z: 1 color: dropArea2.containsDrag ? "yellow" : "red" border.color: mouseArea2.containsMouse ? 'black' : 'grey' border.width: 4 DropArea { id: dropArea2 anchors.fill: parent } MouseArea { id: mouseArea2 anchors.fill: parent hoverEnabled: true } } Rectangle { x: 10; y: 10 z: 2 width: 20; height: 20 color: Drag.active == true ? "purple" : "pink" Drag.active: mouseArea.drag.active Drag.hotSpot.x: 10 Drag.hotSpot.y: 10 MouseArea { id: mouseArea anchors.fill: parent drag.target: parent } } }