About pyQt4
I prefer to use the static method for getSaveFilename in QFileDialog so that the user sees the native Windows / Mac dialog.
My problem is that if the user does not enter the file extension in the name of the save file (say, when choosing the type of image to save the file as), then I have no way to check what type of file they wanted to save as.
How to create a dialog to save files with a filter and find out which filter the user has selected?
For instance:
files_types = "GML (*.gml);;Pickle (*.pickle);;YAML (*.yml)"
file = QtGui.QFileDialog.getSaveFileName(self, 'Save file', '', files_types)
With the var file, I will only have the path to the file, but I'm not sure which format the user chose.
So, I want to know how to get the extension or file type selected by the user. Is it possible to get the selected filter using this method?
Thank you so much!