I'm using the following code to the new property of the filedialog under QtQuick.Dialogs 1.3 & Qt 5.10.0. I've build it using Qt Creator 5.10 default kit.
import QtQuick 2.10
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.3
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
FileDialog {
id: fileDialog
title: "Please choose a file"
folder: shortcuts.home
defaultSuffix: "txt"
selectExisting: false
selectMultiple: false
onAccepted: {
console.log("You chose: " + fileUrl)
Qt.quit()
}
onRejected: {
console.log("Canceled")
Qt.quit()
}
Component.onCompleted: visible = true
}
}
My expectation are that if I choose a filename such as "MyFile", then the fileUrl would be "MyFile.txt". However it just returns "MyFile".