Grubuntu / PieMenu

Fork of PieMenu, with some improvements
10 stars 4 forks source link

Using pyside6 is broken with FreeCAD 0.21 #76

Open sdifru opened 5 months ago

sdifru commented 5 months ago

It seems like freecad now use qt6 and pyside6. I'm on arch linux and I got this error: During initialization the error "No module named 'PySide2'" occurred in /home/myname/.local/share/FreeCAD/Mod/PieMenu/./InitGui.py.

Could PieMenu use pyside6 instead of pyside2?

Grubuntu commented 5 months ago

It seems that we can now use pyside instead of pyside2, it will call the pyside version which is in FreeCAD: https://forum.freecad.org/viewtopic.php?t=85089#p739422

Try this : at the beginning of your InitGui.py, (/home/myname/.local/share/FreeCAD/Mod/PieMenu/./InitGui.py) edit the 3 lines:

    from PySide2.QtGui import QKeyEvent, QFontMetrics
    from PySide2.QtGui import QKeySequence
    from PySide2.QtCore import Qt

replace them by :


    from PySide.QtGui import QKeyEvent, QFontMetrics
    from PySide.QtGui import QKeySequence
    from PySide.QtCore import Qt

let me know if it works correctly I'll update for future versions. Thanks

sdifru commented 5 months ago

It shows error During initialization the error "cannot import name 'QAction' from 'PySide.QtWidgets' (/usr/lib/freecad/Ext/PySide/QtWidgets.py)" occurred in /home/myname/.local/share/FreeCAD/Mod/PieMenu/./InitGui.py

Grubuntu commented 5 months ago

Sorry, I didn't have enough time to look at it, over the last few days.

Can you try modifying the imports like this :

    import os
    import math
    import operator
    import platform
    import FreeCAD as App
    import FreeCADGui as Gui
    import PieMenuLocator as locator
    from TranslateUtils import translate
    from FreeCAD import Units
    from PySide import QtCore
    from PySide import QtGui, QtWidgets
    from PySide.QtWidgets import QApplication, QCheckBox, QComboBox, QDialog, QFileDialog, \
                QGroupBox, QHBoxLayout, QLabel, QLineEdit, QListWidget, QListWidgetItem, \
                QMessageBox, QPushButton, QVBoxLayout, QWidget
    from PySide.QtGui import QKeyEvent, QFontMetrics, QKeySequence, QAction, QShortcut
    from PySide.QtCore import Qt

Thanks for your help.

sdifru commented 5 months ago

Freecad crashed with message: Program received signal SIGSEGV, Segmentation fault.

hasecilu commented 5 months ago

I'm able to use PieMenu on Arch Linux using the latest weekly build AppImage, but freecad package (FC 0.21) is totally broken, also can't even compile.

Grubuntu commented 4 months ago

This seems to be linked to the FreeCAD 0.21 and Qt6 code. We'll have to wait for an update to FreeCAD 0.21.

https://github.com/FreeCAD/FreeCAD/issues/13303 https://github.com/FreeCAD/FreeCAD/issues/13427

Seems to work with 0.22dev