FileDialog set preset file name
Unsolved
QML and Qt Quick
-
How set preset file name in FileDialog ?
If I do this:QLP.FileDialog { id: fileDialogSaveFile title: qsTr("Select file") nameFilters: [ "JSON files (*.json)" ] currentFile: "1234" fileMode: QLP.FileDialog.SaveFile
then I get preset like: "/qml/frames/aboutProgram/1234.json" - it's path in frames
-
Hi,
i think your problem is in the currentFile: you need to set all path and need to be valid more the new file name likeQLP.FileDialog { id: fileDialogSaveFile title: qsTr("Select file") nameFilters: [ "JSON files (*.json)" ] currentFile: StandardPaths.writableLocation(StandardPaths.DownloadLocation) + "/" + 1234 folder: StandardPaths.writableLocation( StandardPaths.DownloadLocation) fileMode: QLP.FileDialog.SaveFile