QML FileDialog, selecting folder and file
-
wrote on 4 Sept 2020, 09:53 last edited by
Hello,
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 ?
Thanks ! -
Hello,
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 ?
Thanks !wrote on 4 Sept 2020, 11:59 last edited by JonB 9 Apr 2020, 12:00@EmilieG
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! -
wrote on 7 Sept 2020, 08:37 last edited by
Thanks for your answer but the solution exposed in this thread is not working properly..
-
wrote on 7 Sept 2020, 13:29 last edited by
There is a custom implementation in the comments. But it doesn't seem to work.
2/5