Draft workbench Offset function doesn't work After ArchLinux patched FreeCAD to use Qt6/PySide6
Description:
Bug report:
With a closed sketch, using the Draft workbench Offset toolbar button ( https://wiki.freecad.org/Draft_Offset ) causes the following error message to be dumped to the Report View:
15:48:04 GuiCommand: Offset
15:48:04 Running the Python command 'Draft_Offset' failed:
Traceback (most recent call last):
File "/usr/lib/freecad/Mod/Draft/draftguitools/gui_offset.py", line 87, in Activated
self.proceed()
File "/usr/lib/freecad/Mod/Draft/draftguitools/gui_offset.py", line 103, in proceed
self.ui.offsetUi()
File "/usr/lib/freecad/Mod/Draft/DraftGui.py", line 864, in offsetUi
self.taskUi(translate("draft","Offset"), icon="Draft_Offset")
File "/usr/lib/freecad/Mod/Draft/DraftGui.py", line 714, in taskUi
self.setupToolBar(task=True)
File "/usr/lib/freecad/Mod/Draft/DraftGui.py", line 409, in setupToolBar
boldtxt.setWeight(75)
'PySide6.QtGui.QFont.setWeight' called with wrong argument types:
PySide6.QtGui.QFont.setWeight(int)
Supported signatures:
PySide6.QtGui.QFont.setWeight(PySide6.QtGui.QFont.Weight)
Possible reason:
The traceback refers to this line in FreeCAD source code: https://github.com/FreeCAD/FreeCAD/blob/main/src/Mod/Draft/DraftGui.py#L315C17-L315C26
..where an integer is given as an argument to the Qt's font setWeight function
..whereas the documentation states that the function accepts another type, not an integer:
https://doc.qt.io/qtforpython-6/PySide6/QtGui/QFont.html#PySide6.QtGui.PySide6.QtGui.QFont.setWeight
I believe this bug has come about because ArchLinux patched FreeCAD to use Qt6/PySide6, whereas the FreeCAD sourcecode doesn't yet support this. As per: https://gitlab.archlinux.org/archlinux/packaging/packages/freecad/-/commits/main
Additional info:
- package version(s): freecad 0.21.2-8
- additional package versions: qt6-base 6.6.3-1 (qt6), pyside6 6.6.2-2
- not affected version: freecad 0.21.2-6
- config and/or log files: n/a
- link to upstream bug report, if any:
"Premature migration to QT6, breaking several features."
Reported by someone on EndeavourOS, which appears to be built on top of Arch Linux.
Steps to reproduce:
- Create a sketch and for example a circle inside of it.
- Switch to Draft workbench.
- Click the Offset toolbar button.
- Observe traceback in the Report View area.