Bug report #12511
Allow selecting either a directory or a file in the processing settings
|Affected QGIS version:
|Pull Request or Patch supplied:
|Crashes QGIS or corrupts data:
|Copied to github as #:
Custom processing providers would benefit from being able to explicitly choose between a QFileDialog that allows picking a directory or a file. The current implementation seems very counter-intuitive. Please check the method:
Basically, if the previously selected path is a file, Processing presents the user with a dialog for selecting a file. Otherwise, it produces a dialog for selecting a directory. So if the user never manually types some valid file path in the line edit, (s)he will never be presented with a file selection dialog.
There seems to be some intent in supporting a more explicit behavior in:
Instances of the
Setting class actually have a
valuetype attribute. Presumably this would take a value of either
Setting.FOLDER and the
SettingDelegate.createEditor() method would use it to create the appropriate dialog.