qfiledialog – Filtering Folders?

You can try setting a proxy model for your file dialog: QFileDialog::setProxyModel. In the proxy model class override the filterAcceptsRow method and return false for folders which you don’t want to be shown. Below is an example of how proxy model can look like; it’c c++, let me know if there are any problems converting … Read more

Is there a difference between QFileDialog strings in PyQt4 and PyQt5?

The getOpenFileName function in PyQt4 returns a string that is the name of the selected file, and if none is selected then it returns an empty string. filename = QFileDialog.getOpenFileName(self, “Open Template”, “c:\\”, “Templates (*.xml);;All Files (*.*)”) However in PyQt5 this returns a tuple of 2 elements where the first one is a string that … Read more