3

How would I set a file filter for QGSFileWidget for multiple file types, xlsx, csv etc

I've worked out where: enter image description here

But I'm unsure what the string needs to look like - what separator to use etc? I'm new to QT Designer and I'm not sure where to find documentation with examples on the widgets

1 Answer 1

5

Documentation is here: https://qgis.org/pyqgis/3.28/gui/QgsFileWidget.html#qgis.gui.QgsFileWidget.setFilter .

Try setting the filter to

All files (*.*);;JPEG (*.jpg *.jpeg);;TIFF (*.tif)

As per the answer https://stackoverflow.com/a/1604542 that relates to the standard QT File Dialog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.