Get QFileDialog to display dot folder/files?
I did some searching, but, no luck, and, maybe I don't know how to phrase the search...
Using QFileDialog, how do I get it to show files and folders that begin with a period (or dot), for example, in a home folder in Linux you typically have:
/home/user/.config
In this case a folder.
or:
/home/user/.bashrc
In this case a file.
Re: Get QFileDialog to display dot folder/files?
You have to tell QFileDialog what to show, by default, hidden files are not shown. Look at the filter options for QFileDialog::setFilters, in particular QDir::Hidden. You probably also want QDir::NoDotAndDotDot, etc.
Re: Get QFileDialog to display dot folder/files?
Thanks!
That's the bump I needed. :)
For future readers:
Code:
fdlg.
setFilter(QDir.
AllEntries |
QDir.
Hidden) if (fdlg.exec()):
fileNames = fdlg.selectedFiles()
fdlg.close()
Shows .name, ..name, folder or files.