Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

FileDialog save file default name



  • Hi,
    how to preset file name in qml save file dialog (I want to set some default file name in the dialog)?

    Thanks



  • It's not possible. Even worse, if you reuse the FileDialog, it will default to the last file selected even if this is not what you want. This is one of many bugs and missing features why I think that QtQuick Controls are simply not ready for production use.

    There is no simple workaround but if you are willing to add custom C++ code to your QML project, have a look at Advanced FileDialog in QML, which presents a solution that works on Windows, Mac and Gnome.


  • Qt Champions 2016

    @MartinD Set the folder property of FileDialog to the url of the target folder with the preset file name.

    e.g

    file:/tmp/filename.txt
    

Log in to reply