Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How do I perform simple drag and drop?

$
0
0
I’m trying to drag and drop one square to another, using this code: //where I want to drag from Connector {     id: connector     anchors.right: parent.right     MouseArea {         id:dragArea         anchors.fill: parent         drag.target: dragDummy         onReleased: {             console.log("Released");         }         Rectangle{             id:dragDummy             color:'pink'             width:radius*2             height:radius*2             radius: 4         }     } } //where i want to drop something Connector {     id: connector     anchors.left: parent.left     DropArea{         anchors.fill: parent         Rectangle{             anchors.fill: parent             color: "blue"         }         onDropped: {             console.log("Dropped");         }     } } I can see the pink circle moving when i drag it, but “Dropped” is never printed when I release it in the blue area. What am I missing?

Viewing all articles
Browse latest Browse all 4972

Trending Articles