I'm not sure if this is the right forum, for this question, but I'm posting it here because I believe it is related to my build of FreeCad. I do not experience this problem when I run a recent appImg.
The problem is, I get the following error when I run a macro (widgetExample)
Code: Select all
02:09:43 Traceback (most recent call last):
File "/home/jody/.local/share/FreeCAD/Macro/widgetExample.FCMacro", line 1, in <module>
from PySide.QtGui import QWidget, QLabel, Qt, QVBoxLayout, QHBoxLayout, QPushButton, QListWidget, QListWidgetItem
<class 'ImportError'>: cannot import name 'Qt' from 'PySide.QtGui' (/home/jody/freecad/freecad-build/Ext/PySide/QtGui.py)
Code: Select all
This software uses open source components whose copyright and other proprietary rights belong to their respective owners:
Boost 1_67
https://www.boost.org
Coin3D 4.0.0a
https://coin3d.github.io
Eigen 3.3.7
https://eigen.tuxfamily.org
FreeType 2.9.1
https://freetype.org
KDL
https://www.orocos.org/kdl
libarea
https://github.com/danielfalck/libarea
Open CASCADE Technology 7.3.0
https://www.opencascade.com/open-cascade-technology/
Point Cloud Library
https://www.pointclouds.org
PyCXX 7.1.7
http://cxx.sourceforge.net
Python 3.7.3
https://www.python.org
Qt for Python (PySide) 5.11.2
https://wiki.qt.io/Qt_for_Python
Qt 5.11.3
https://www.qt.io
Salome SMESH
https://salome-platform.org
Qt for Python (Shiboken) 5.11.2
https://wiki.qt.io/Qt_for_Python
vtk 6.3.0
https://www.vtk.org
Xerces-C 3.2.2
https://xerces.apache.org/xerces-c
Zipios++
http://zipios.sourceforge.net
zlib 1.2.11
https://zlib.net
Code: Select all
from PySide.QtGui import QWidget, QLabel, Qt, QVBoxLayout, QHBoxLayout, QPushButton, QListWidget, QListWidgetItem
class MyWidget(QWidget):
def __init__(self,text):
super(MyWidget,self).__init__()
label = QLabel(text)
label.setAlignment(Qt.AlignCenter | Qt.AlignRight)
button = QPushButton("push me!")
layout = QHBoxLayout()
layout.addWidget(label)
layout.addWidget(button)
self.setLayout(layout)
class MyWindow(QWidget):
def __init__(self):
super(MyWindow,self).__init__()
list = QListWidget()
listItem = QListWidgetItem(list)
listItemWidget = MyWidget("listItem")
listItem.setSizeHint(listItemWidget.sizeHint())
list.addItem("Item one")
list.addItem("Item two")
list.addItem(listItem)
list.setItemWidget(listItem,listItemWidget)
myWidget1 = MyWidget("test1")
layout = QVBoxLayout()
layout.addWidget(myWidget1)
layout.addWidget(list)
self.setLayout(layout)
mySize = QtCore.QSize(1000, 200)
self.setFixedSize(mySize)
self.show()
myWin=MyWindow()
Code: Select all
OS: Debian GNU/Linux 10 (buster) (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.21.30623 (Git)
Build type: Unknown
Branch: myWorkBranch
Hash: 27f08f38b1658e419e20a153e13236eff1293b77
Python 3.7.3, Qt 5.11.3, Coin 4.0.0a, Vtk 6.3.0, OCC 7.3.0
Locale: English/UnitedStates (en_US)
Installed mods:
* lattice2 1.0.0
* Assembly4 0.12.4
* Curves 0.5.8
* fasteners 0.4.13
* sheetmetal 0.2.57
Any ideas or suggestions would be greatly appreciated! Also, if there isany other information I can post that would help, please let me know.
Jody