openBrain wrote: ↑Mon Apr 25, 2022 7:53 am
Yes, this is a known issue (that I never investigated the cause) where 'qApp' isn't existing or initialized in PySide.
Hence I use
QtWidgets.QApplication.instance() in my version --notice this is PySide2--.
You can also use
QtCore.QCoreApplication.instance() --if your macro should work in CLI/headless mode-- or
QtGui.QGuiApplication.instance() --if you don't deal with widgets--.
This error is only at Ubuntu 22.04 LTS natively installed (sudo apt-get install freecad) but for
repacked the newest appimage there is no errors and everything works fine.
I am not sure if I should fix this bug for incorrect installations. User would not be able to recognize the installation is invalid. If the error would be only for this macro it could be fixed but there are more errors with freecad working, especially to draft. So maybe it is better to clearly point out that something is wrong.
However, for the native installation I have also problem with setTextures macro. While I am trying to load textures I have bug:
Code: Select all
10:05:50 Traceback (most recent call last):
10:05:50 File "/home/user/.FreeCAD/Mod/Woodworking/Tools/setTextures.py", line 144, in <lambda>
10:05:50 self.step4b.clicked.connect(lambda: self.checkSelected("load", "all"))
10:05:50 File "/home/user/.FreeCAD/Mod/Woodworking/Tools/setTextures.py", line 407, in checkSelected
10:05:50 self.loadStoredTextures(searchObjects)
10:05:50 File "/home/user/.FreeCAD/Mod/Woodworking/Tools/setTextures.py", line 331, in loadStoredTextures
10:05:50 for i in rootnode.getChildren():
10:05:50 File "/usr/lib/python3/dist-packages/pivy/coin.py", line 613, in __iter__
10:05:50 yield self[i]
10:05:50 File "/usr/lib/python3/dist-packages/pivy/coin.py", line 2562, in __getitem__
10:05:50 return _coin.SoNodeList___getitem__(self, i)
10:05:50 SystemError: <built-in function SoNodeList___getitem__> returned a result with an exception set
Also the code for debug info not works but the clipboard from about info works:
Code: Select all
OS: Ubuntu 22.04 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.10.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)
This is little serious because all people who install Ubuntu 22.04 they get such errors and to get correctly working FreeCAD they have to rebuild the appimage. I am not sure how many users will be able to do that ;-(