Set filechooser to return a single url

This commit is contained in:
Angela Mazzurco 2017-07-12 16:20:59 +02:00
parent e268fe0145
commit 9a621b7509

View File

@ -14,9 +14,10 @@ Item
folder: shortcuts.pictures folder: shortcuts.pictures
nameFilters: [ "Image files (*.png *.jpg)"] nameFilters: [ "Image files (*.png *.jpg)"]
visible: false visible: false
selectMultiple: false
onAccepted: { onAccepted: {
console.log("You chose: " + fileDialog.fileUrls) console.log("You chose: " + fileDialog.fileUrl)
resultFile = fileDialog.fileUrls resultFile = fileDialog.fileUrl
} }
onRejected: { onRejected: {
console.log("Canceled") console.log("Canceled")
@ -40,7 +41,7 @@ Item
function androidResult (uri) function androidResult (uri)
{ {
console.log("@@@@@@@@@ Android image uri found" , uri) console.log("Android image uri found" , uri)
resultFile = uri resultFile = uri
mainWindow.delUriHandler("media", androidResult) mainWindow.delUriHandler("media", androidResult)
} }