Supporting Qt 6 - What's needed?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Supporting Qt 6 - What's needed?

Post by yorik »

babaroga wrote: Wed Feb 02, 2022 11:29 pmPath, Draft and Arch is not working.
These all depend on pivy. I suspect pivy is not working or not compiled with Qt6.
User avatar
babaroga
Posts: 178
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Supporting Qt 6 - What's needed?

Post by babaroga »

My Pivy was built from git source.
Cmake found Qt6 libraries during build. How can I check if pivy is compiled with Qt6

Ah yes, AddonManager also does not start , with "Failed to wrap widget"error

This is what I on Draft WB

Code: Select all

15:25:34  Please look into the log file for further information
15:26:02  Failed to wrap widgetError: Initializing one or more of the Draft modules failed, Draft will not work as expected.
15:26:02  Unknown command 'Draft_Fillet'
15:26:02  Unknown command 'Draft_Circle'
15:26:02  Unknown command 'Draft_Ellipse'
15:26:02  Unknown command 'Draft_Rectangle'
15:26:02  Unknown command 'Draft_Polygon'
15:26:02  Unknown command 'Draft_BSpline'
15:26:02  Unknown command 'Draft_Point'
15:26:02  Unknown command 'Draft_Facebinder'
15:26:02  Unknown command 'Draft_ShapeString'
15:26:02  Unknown command 'Draft_Text'
15:26:02  Unknown command 'Draft_Dimension'
15:26:02  Unknown command 'Draft_Label'
15:26:02  Unknown command 'Draft_AnnotationStyleEditor'
15:26:02  Unknown command 'Draft_Move'
15:26:02  Unknown command 'Draft_Rotate'
15:26:02  Unknown command 'Draft_Scale'
15:26:02  Unknown command 'Draft_Mirror'
15:26:02  Unknown command 'Draft_Offset'
15:26:02  Unknown command 'Draft_Trimex'
15:26:02  Unknown command 'Draft_Stretch'
15:26:02  Unknown command 'Draft_Clone'
15:26:02  Unknown command 'Draft_Edit'
15:26:02  Unknown command 'Draft_SubelementHighlight'
15:26:02  Unknown command 'Draft_Join'
15:26:02  Unknown command 'Draft_Split'
15:26:02  Unknown command 'Draft_Upgrade'
15:26:02  Unknown command 'Draft_Downgrade'
15:26:02  Unknown command 'Draft_WireToBSpline'
15:26:02  Unknown command 'Draft_Draft2Sketch'
15:26:02  Unknown command 'Draft_Slope'
15:26:02  Unknown command 'Draft_FlipDimension'
15:26:02  Unknown command 'Draft_Shape2DView'
15:26:02  Unknown command 'Draft_Layer'
15:26:02  Unknown command 'Draft_AddNamedGroup'
15:26:02  Unknown command 'Draft_AddToGroup'
15:26:02  Unknown command 'Draft_SelectGroup'
15:26:02  Unknown command 'Draft_AddConstruction'
15:26:02  Unknown command 'Draft_ToggleDisplayMode'
15:26:02  Unknown command 'Draft_WorkingPlaneProxy'
15:26:02  Unknown command 'Draft_Fillet'
15:26:02  Unknown command 'Draft_Circle'
15:26:02  Unknown command 'Draft_Ellipse'
15:26:02  Unknown command 'Draft_Rectangle'
15:26:02  Unknown command 'Draft_Polygon'
15:26:02  Unknown command 'Draft_BSpline'
15:26:02  Unknown command 'Draft_Point'
15:26:02  Unknown command 'Draft_Facebinder'
15:26:02  Unknown command 'Draft_ShapeString'
15:26:02  Unknown command 'Draft_Text'
15:26:02  Unknown command 'Draft_Dimension'
15:26:02  Unknown command 'Draft_Label'
15:26:02  Unknown command 'Draft_AnnotationStyleEditor'
15:26:02  Unknown command 'Draft_Move'
15:26:02  Unknown command 'Draft_Rotate'
15:26:02  Unknown command 'Draft_Scale'
15:26:02  Unknown command 'Draft_Mirror'
15:26:02  Unknown command 'Draft_Offset'
15:26:02  Unknown command 'Draft_Trimex'
15:26:02  Unknown command 'Draft_Stretch'
15:26:02  Unknown command 'Draft_Clone'
15:26:02  Unknown command 'Draft_Edit'
15:26:02  Unknown command 'Draft_SubelementHighlight'
15:26:02  Unknown command 'Draft_Join'
15:26:02  Unknown command 'Draft_Split'
15:26:02  Unknown command 'Draft_Upgrade'
15:26:02  Unknown command 'Draft_Downgrade'
15:26:02  Unknown command 'Draft_WireToBSpline'
15:26:02  Unknown command 'Draft_Draft2Sketch'
15:26:02  Unknown command 'Draft_Slope'
15:26:02  Unknown command 'Draft_FlipDimension'
15:26:02  Unknown command 'Draft_Shape2DView'
15:26:02  Unknown command 'Draft_SetStyle'
15:26:02  Unknown command 'Draft_ApplyStyle'
15:26:02  Unknown command 'Draft_Layer'
15:26:02  Unknown command 'Draft_AddNamedGroup'
15:26:02  Unknown command 'Draft_AddToGroup'
15:26:02  Unknown command 'Draft_SelectGroup'
15:26:02  Unknown command 'Draft_ToggleConstructionMode'
15:26:02  Unknown command 'Draft_AddConstruction'
15:26:02  Unknown command 'Draft_ToggleDisplayMode'
15:26:02  Unknown command 'Draft_ToggleGrid'
15:26:02  Unknown command 'Draft_SelectPlane'
15:26:02  Unknown command 'Draft_WorkingPlaneProxy'
15:26:02  Unknown command 'Draft_Heal'
15:26:02  Unknown command 'Draft_ToggleContinueMode'
15:26:02  Unknown command 'Draft_ShowSnapBar'

This is what I get on starting Path workbench

Code: Select all

15:29:28  Failed to wrap widget
15:29:28  Traceback (most recent call last):
  File "<string>", line 90, in Initialize
  File "/home/senja/FCQt6/fcqt6-build/Mod/Path/PathScripts/PathGuiInit.py", line 58, in Startup
    from PathScripts import PathInspect
  File "/home/senja/FCQt6/fcqt6-build/Mod/Path/PathScripts/PathInspect.py", line 91, in <module>
    class GCodeEditorDialog(QtGui.QDialog):
  File "/home/senja/FCQt6/fcqt6-build/Mod/Path/PathScripts/PathInspect.py", line 94, in GCodeEditorDialog
    def __init__(self, PathObj, parent=FreeCADGui.getMainWindow()):

And this when I start Arch

Code: Select all

15:33:30  Failed to wrap widget
15:33:30  Traceback (most recent call last):
  File "<string>", line 52, in Initialize
  File "/home/senja/FCQt6/fcqt6-build/Mod/Draft/DraftTools.py", line 51, in <module>
    import DraftGui  # Initializes the DraftToolBar class
  File "/home/senja/FCQt6/fcqt6-build/Mod/Draft/DraftGui.py", line 2421, in <module>
    FreeCADGui.draftToolBar = DraftToolBar()
  File "/home/senja/FCQt6/fcqt6-build/Mod/Draft/DraftGui.py", line 308, in __init__
    mw = FreeCADGui.getMainWindow()
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: Supporting Qt 6 - What's needed?

Post by jonasb »

babaroga wrote: Fri Feb 04, 2022 11:31 am ... "Failed to wrap widget" error
I remember that I had the exact same problem when I first tried to build FreeCAD on macOS. It tuned out that I had build PySide2 (and/or Shiboken2) against a different Qt than FreeCAD itself.
StSt94
Posts: 6
Joined: Wed Jan 26, 2022 7:52 pm

Re: Supporting Qt 6 - What's needed?

Post by StSt94 »

yorik wrote: Thu Feb 03, 2022 10:54 am
babaroga wrote: Wed Feb 02, 2022 11:29 pmPath, Draft and Arch is not working.
These all depend on pivy. I suspect pivy is not working or not compiled with Qt6.
I fear it is not that easy...
I compiled coin and pivy from source and linked it agains qt6 which was almost no problem.

However, PySide6 changes some things. Mainly, lots of classes (probably all widget Classes) from "PySide.QtGui" are now implemented by "PySide6.QtWidgets". I already did lots of replacing (see: https://github.com/StStME/FreeCAD/commi ... 16b041abdd)
But it is still not working.

What would be really helpful if you have some debugging tips on that topic.
babaroga wrote: Fri Feb 04, 2022 11:31 am This is what I get on starting Path workbench

Code: Select all

15:29:28  Failed to wrap widget
15:29:28  Traceback (most recent call last):
  File "<string>", line 90, in Initialize
  File "/home/senja/FCQt6/fcqt6-build/Mod/Path/PathScripts/PathGuiInit.py", line 58, in Startup
    from PathScripts import PathInspect
  File "/home/senja/FCQt6/fcqt6-build/Mod/Path/PathScripts/PathInspect.py", line 91, in <module>
    class GCodeEditorDialog(QtGui.QDialog):
  File "/home/senja/FCQt6/fcqt6-build/Mod/Path/PathScripts/PathInspect.py", line 94, in GCodeEditorDialog
    def __init__(self, PathObj, parent=FreeCADGui.getMainWindow()):

And this when I start Arch

Code: Select all

15:33:30  Failed to wrap widget
15:33:30  Traceback (most recent call last):
  File "<string>", line 52, in Initialize
  File "/home/senja/FCQt6/fcqt6-build/Mod/Draft/DraftTools.py", line 51, in <module>
    import DraftGui  # Initializes the DraftToolBar class
  File "/home/senja/FCQt6/fcqt6-build/Mod/Draft/DraftGui.py", line 2421, in <module>
    FreeCADGui.draftToolBar = DraftToolBar()
  File "/home/senja/FCQt6/fcqt6-build/Mod/Draft/DraftGui.py", line 308, in __init__
    mw = FreeCADGui.getMainWindow()
Thanks babaroga!

This is exactly where I am stuck right now.
With the mods from the latest commit I get some Dialog Window in Arch and Draft but the Error Message persists.
I guess the return value of that Function is not correct (getMainWindow) but the Problem is hidden somewhere deeper inside.
User avatar
babaroga
Posts: 178
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Supporting Qt 6 - What's needed?

Post by babaroga »

I will start looking at something simpler since I am not very much skilled with programming.

So on FC start there is also not working module:
- TUX (really, what is it used for?)

Further not working WB's are:
- Render
- Addon Manager

Addons starting OK:
- Manipulator
- Raytracing
- Sheet Metal
- KicadStepUp
- Curves

Addons not starting:
- A2P
- Assembly4
- Fasteners

I will look at this smaller ones to get idea about whole thing.
StSt94
Posts: 6
Joined: Wed Jan 26, 2022 7:52 pm

Re: Supporting Qt 6 - What's needed?

Post by StSt94 »

babaroga wrote: Fri Feb 04, 2022 9:15 pm I will start looking at something simpler since I am not very much skilled with programming.

So on FC start there is also not working module:
- TUX (really, what is it used for?)
.
.
.
Nothing I can Answer you :D

I really appreciate your help, thank you! :)

About the getMainWindow() issue:

Code: Select all

/**
*   This function template is used to get the PyTypeObject of a C++ type T.
*   All implementations should be provided by template specializations generated by the generator when
*   T isn't a C++ primitive type.
*   \see SpecialCastFunction
*/
template<typename T> PyTypeObject *SbkType() { return nullptr; }
I found this peace of code returns a nullptr. There seems to be an issue with generating some files with shiboken. I will take a closer look but first need to get a better understanding of *that*.
StSt94
Posts: 6
Joined: Wed Jan 26, 2022 7:52 pm

Re: Supporting Qt 6 - What's needed?

Post by StSt94 »

babaroga wrote: Fri Feb 04, 2022 9:15 pm I will start looking at something simpler since I am not very much skilled with programming.

So on FC start there is also not working module:
- TUX (really, what is it used for?)

Further not working WB's are:
- Render
- Addon Manager

Addons starting OK:
- Manipulator
- Raytracing
- Sheet Metal
- KicadStepUp
- Curves

Addons not starting:
- A2P
- Assembly4
- Fasteners

I will look at this smaller ones to get idea about whole thing.

I pushed some changes again. though it got a little wild, would you mind testing on your end? I first need to check for missing symbols and might recompile Shiboken.. but not today anymore

Thanks you :)
User avatar
babaroga
Posts: 178
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Supporting Qt 6 - What's needed?

Post by babaroga »

Nope! Not OK

Code: Select all

[ 12%] Linking CXX shared library ../../lib/libFreeCADGui.so
/usr/bin/ld: CMakeFiles/FreeCADGui.dir/PythonWrapper.cpp.o: in function `Gui::PythonWrapper::loadCoreModule()':
PythonWrapper.cpp:(.text+0x1507): undefined reference to `SbkPySide6_QtCoreTypes'
/usr/bin/ld: PythonWrapper.cpp:(.text+0x1568): undefined reference to `SbkPySide6_QtCoreTypes'
/usr/bin/ld: CMakeFiles/FreeCADGui.dir/PythonWrapper.cpp.o: in function `Gui::PythonWrapper::loadGuiModule()':
PythonWrapper.cpp:(.text+0x15e9): undefined reference to `SbkPySide6_QtGuiTypes'
/usr/bin/ld: PythonWrapper.cpp:(.text+0x164a): undefined reference to `SbkPySide6_QtGuiTypes'
/usr/bin/ld: CMakeFiles/FreeCADGui.dir/PythonWrapper.cpp.o: in function `_typeobject* Shiboken::SbkType<QDir>()':
PythonWrapper.cpp:(.text._ZN8Shiboken7SbkTypeI4QDirEEP11_typeobjectv[_ZN8Shiboken7SbkTypeI4QDirEEP11_typeobjectv]+0x7): undefined reference to `SbkPySide6_QtCoreTypes'
/usr/bin/ld: CMakeFiles/FreeCADGui.dir/PythonWrapper.cpp.o: in function `_typeobject* Shiboken::SbkType<QObject>()':
PythonWrapper.cpp:(.text._ZN8Shiboken7SbkTypeI7QObjectEEP11_typeobjectv[_ZN8Shiboken7SbkTypeI7QObjectEEP11_typeobjectv]+0x7): undefined reference to `SbkPySide6_QtCoreTypes'
/usr/bin/ld: CMakeFiles/FreeCADGui.dir/PythonWrapper.cpp.o: in function `_typeobject* Shiboken::SbkType<QIcon>()':
PythonWrapper.cpp:(.text._ZN8Shiboken7SbkTypeI5QIconEEP11_typeobjectv[_ZN8Shiboken7SbkTypeI5QIconEEP11_typeobjectv]+0x7): undefined reference to `SbkPySide6_QtGuiTypes'
/usr/bin/ld: CMakeFiles/FreeCADGui.dir/PythonWrapper.cpp.o: in function `_typeobject* Shiboken::SbkType<QWidget>()':
PythonWrapper.cpp:(.text._ZN8Shiboken7SbkTypeI7QWidgetEEP11_typeobjectv[_ZN8Shiboken7SbkTypeI7QWidgetEEP11_typeobjectv]+0x7): undefined reference to `SbkPySide6_QtWidgetsTypes'
collect2: error: ld returned 1 exit status
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/build.make:6103: lib/libFreeCADGui.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:6406: src/Gui/CMakeFiles/FreeCADGui.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Supporting Qt 6 - What's needed?

Post by yorik »

note that since the migration from pyside to pyside2, some modules were already moved from QtGui to QtWidgets. To ease the transition and not break any FreeCAD WB, the PySide wrapper in FreeCAD includes these modules. Maybe it needs to be extended? (cannot find back where in the source..)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Supporting Qt 6 - What's needed?

Post by Kunda1 »

Is it me or is it that the Qt6 cycle is moving fast? It's already at v6.3.0
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply