I have a Row
id:dragList
contains a list of items like below:
Item {
id: dragItem
Drag.active: dragArea.drag.active
//Drag.dragType: Drag.Automatic
MouseArea{
id: dragArea
anchors.fill: parent
drag.target: parent
onReleased: parent.Drag.drop()
}
state: "Init"
states: [
State {
name: "Init"
ParentChange { target: dragItem; parent: dragList }
},
State {
name: "Settle"
ParentChange { target: dragItem; parent: dropArea }
}
]
}
And a DropArea
id:dropArea
.
If drag the item and drop it into the correct dropArea
, will relocate it to a certain position inside of dropArea
by changing the state to "Settle"
. otherwise, it will return back to the Row
by setting back the state to "Init"
.
So How to put the dragged out item back to the Row
?
I tried PropertyChanges { target: dragMotor; x: undefined}
but not work.