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 show a file dialog with only executable files. However, it shows no files at all (and no directories either) even though there are executable files in the directory.
self.browseDialog = QtGui.QFileDialog()
self.browseDialog.setFilter(QtCore.QDir.Executable | QtCore.QDir.Files)
self.browseDialog.exec_()
Am I doing something wrong? Can this be achieved? I would also like to do something a little more complex: show files that are executable or end with certain extensions.
I am using PyQt 4.7.4 on Ubuntu Maverick.