FileDialog in QTQuick (QML): Save file under given name

This blog post covers the whole problem and provides a possible solution: Advanced FileDialog in QML (Save file under given name) (RIP Kullo blog)

The repository implementing the solution is here: https://github.com/kullo/qml-file-dialog-demo


Try setting the FileDialog selectExisting property to false.


I hope this will be still helpful. I found a compromise that at least works for me. I used Qt.labs.platform 1.1 FileDialog QML Type: https://doc.qt.io/qt-5/qml-qt-labs-platform-filedialog.html

FileDialog {
            id: saveDialog
            property MyClass myObj
            title: "Save Dialog"
            folder: myObjHasAPath? myObj.path: "file:///" //Here you can set your default folder
            currentFile: "file:///"+myObj.name //The name of the item that you want to save
            fileMode: Platform.FileDialog.SaveFile
        }