I am trying to make a file picker to select a program (executable file).
My understanding of the documentation for QDir and QFileDialog is that the following should
I am using PyQt5 but had to do a similar thing only I wanted just .txt files. To perform this I used getFileOpenName() and the filter= option. It worked fine for my purposes. The function names have changed from PyQt4 to PyQt5, but the link below has the names of the PyQt4 alternatives.
http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html
The getOpenFileNameAndFilter(), getOpenFileNamesAndFilter() and getSaveFileNameAndFilter() methods of PyQt4’s QFileDialog have now been renamed getOpenFileName(), getOpenFileNames() and getSaveFileName() respectively in PyQt5. PyQt4’s implementations of getOpenFileName(), getOpenFileNames() and getSaveFileName() are not supported in PyQt5.