but i'm stuck with importing QtWidgets. I had found a nice method somewhere but can't find it back (below my result).
Code: Select all
def Activated(self):
#"Do something here"
#"for examples checkmanipulator wb"
from PySide2 import QtUiTools
from PySide2 import QtGui
from PySide2 import QtCore
from PySide2 import QtWidgets
# from PySide import QtWidgets
w = QtWidgets.QWidget()
ui = QtUiTools.QUiLoader()
# ui = FreeCADGui.UiLoader() # change later on. First swap spinbox to quantity spinbox
ui.load(os.path.join(ui_path, 'ui_widget.ui'), w)
return
I got this error message.
Code: Select all
Running the Python command 'command_1' failed:
Traceback (most recent call last):
File "C:\Users\USER\AppData\Roaming\FreeCAD\Mod\custom_workbench\command_1.py", line 31, in Activated
from PySide2 import QtWidgets
cannot import name 'QtWidgets'
Can anybody explain what happens?