I am writing a QGis 2.18 plugin. I am designing the plugin with QT, using QGis widgets. I can use QgsFileWidget to open file, but I did not find how to use it to save file. If I try to define an output filename from my plugin, I read an error saying the file could not be found, which I believe means that the widget is in 'read' mode not in 'save' mode.
How can I set, from my python code, the QgsFileWidget to operate in save mode, and therefore let me define a filename for saving my output?