Created
November 13, 2015 05:15
-
-
Save GaryLee/3d2b74bbd25155d72e57 to your computer and use it in GitHub Desktop.
QML Button which allow drop file to it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Button { | |
id: button1 | |
width: 230 | |
height: 179 | |
text: 'drag file to me' | |
DropArea { | |
id: fileDropArea | |
anchors.fill: parent | |
onEntered: { | |
drag.accept (Qt.CopyAction); | |
console.log("onEntered"); | |
} | |
onDropped: { | |
if (drop.proposedAction == Qt.CopyAction) { | |
drop.acceptProposedAction() | |
} | |
console.log ("onDropped"); | |
} | |
onExited: { | |
console.log ("onExited"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment