In C++ it has the property "Mode" but I don't know how to set it from Python because Mode is a C++ enum. I have tried a few things but nothing of them worked.
Should I try to use the QFileDialog? What is the advantage of the Gui::PrefFileChooser?
Or is the PrefFileChooser only for FreeCAD preferences?
I need it for a taskpanel widget, nothing to do with FreeCAD preferences. In the task panel I would like to retrieve a file path and a directory path for further processing.
bernd wrote: ↑Thu Oct 22, 2020 6:27 pm
Should I try to use the QFileDialog? What is the advantage of the Gui::PrefFileChooser?
Or is the PrefFileChooser only for FreeCAD preferences?
I need it for a taskpanel widget, nothing to do with FreeCAD preferences. In the task panel I would like to retrieve a file path and a directory path for further processing.
bernd
Pref widgets basically offers methods to be saved to and restored from the user settings. They also have a kind a call back when the setting is changed while the widget is active.
If you don't need these functions, using a QFileDialog is totally fine.
Should I try to use the QFileDialog? What is the advantage of the Gui::PrefFileChooser?
It's a compact widget which saves you some extra code. But if it's not possible to use it from Python then it's best to use a file dialog instead.
I need it for a taskpanel widget, nothing to do with FreeCAD preferences. In the task panel I would like to retrieve a file path and a directory path for further processing.
Use standard line edit and a browse button. With the browse button open the file dialog which sets the path to the line edit.