Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QML FileDialog, selecting folder and file
I'm trying to use FileDialog to select either a single file or a single folder (within the same dialog).
My understanding from the documentation page is that it is possible.
FileDialog provides a basic file chooser: it allows the user to select existing files and/or directories, or create new filenames.
However when setting selectFolder to true I can only select folders. Not setting it true, the folders can only be opened not selected. I've also tried adding "Directories" to my nameFilters but it doesn't work..
Is it possible to select either a folder or a file from the same FileDialog ?
JonB last edited by JonB
I am not a QML user, but I don't think so (given what you have tried), despite the "files and/or directories" in the docs.
Please read through all of https://stackoverflow.com/questions/33671350/how-to-select-multiple-files-and-directories-with-qml-filedialog (including all the comments) and see what you think!
Thanks for your answer but the solution exposed in this thread is not working properly..
JonB last edited by
What do you mean? There is no solution in that thread, the point is it is not doable, as I said/suggested....
There is a custom implementation in the comments. But it doesn't seem to work.