How to Drag over other objects?
Can someone help me understand how to reference objects like dropbucket001, dropbucket002, dropbucket003 while I drag dragthis over those objects?
What I am trying to do is make the dropbuckets glow or shake or some other visual effect to indicate that you can drop the object on it.
- import QtQuick 1.0
- Rectangle {
- id: screen
- color: "white"
- width: 400
- height: 300
- Rectangle {
- id: dropbucket001
- x: 10
- y: 10
- color: "blue"
- width: 60
- height: 60
- }
- Rectangle {
- id: dropbucket002
- x: 80
- y: 10
- color: "blue"
- width: 60
- height: 60
- }
- Rectangle {
- id: dropbucket003
- x: 150
- y: 10
- color: "blue"
- width: 60
- height: 60
- }
- Rectangle {
- id: dragthis
- x: 10
- y: 80
- color: "green"
- width: 50
- height: 50
- MouseArea {
- anchors.fill: parent
- drag.target: dragthis
- }
- }
- }
2 replies
You must log in to post a reply. Not a member yet? Register here!


