Fixes#13621.
Currently the legacy DXF importer creates a main group with the DXF name if a DXF is imported into an existing FreeCAD document. For each DXF layer it then creates a sub-group (or Draft Layer) inside that main group. Objects are nested in the sub-groups (or Draft Layers).
This does not make sense for Draft Layers as they should be nested in the LayerContainer, which should be in the root of the FreeCAD document.
Both for Draft Layers and sub-groups there is the issue that if mutliple DXF files are imported in the same FreeCAD document, exising Draft Layers and sub-groups are not taken into account. For each DXF a new "0" group/layer is created (with a Label that is not "0" and therefore not recognized), and if there are objects on that layer a new group/layer is created for each object (labelled "0001", "0002", "0003", etc).
To solve this the main group with the DXF name is no longer created in the revised code and the layers variable is initialized with the groups/layers that already exist in the FreeCAD document.
Additionally the formatObject function should not format objects that are in Draft Layers. Its action conflicts with the layer mechanism resulting in the last imported object having an incorrect color.
* Set parent object to FileCardDelegate so that it will be destroyed if the list view is destroyed
* Inside FileCardDelegate::paint() delete the widget
* Create a compatibility module QtSvgWidgets.py to handle PySide2 & PySide6
* In the Arch and Material modules use the QtSvgWidgets module
* Since Qt6 the method QFont.setWeight() doesn't accept an int any more but requires an enum. Since the call of QFont.setBold(True) sets
a weight of 75 the extra calls of QFont.setWeight(75) can be safely removed
Co-authored-by: Adrián Insaurralde Avalos <36372335+adrianinsaval@users.noreply.github.com>
Improves the MaterialTreeWidget beyond minimum viable product.
- Filters can now be filter lists to allow a variety of filtering
options.
- User preferences allow the inclusion/exclusion of favorites and
recents.
- Widget state such as expansion, tree expansions, etc are saved and
restored.
- show current appearancee material when editing.
- implements a python interface
#fixes 13421: always opens full tree