Make TexSlots draggable

This commit is contained in:
Epicalert 2024-09-10 23:47:18 +08:00
parent 9fdb6822f6
commit 6a8255f67a

View file

@ -11,7 +11,6 @@ DropArea {
width: 128
height: 128
Rectangle {
id: rectangle
anchors.fill: parent
@ -25,7 +24,30 @@ DropArea {
width: 96
height: 96
MouseArea {
id: imageMouseArea
anchors.fill: parent
Drag.dragType: Drag.Automatic
Drag.supportedActions: Qt.CopyAction
Drag.mimeData: {
"text/uri-list": filePath
}
DragHandler {
id: dragHandler
onActiveChanged:
if (active) {
parent.grabToImage(function(result) {
parent.Drag.imageSource = result.url
parent.Drag.active = true
})
} else {
parent.Drag.active = false
}
}
}
}
}