我开发了一个使用QVTKWidget
的QT4 GUI。我试图在Python代码中使用这个小部件,但我不知道如何。
命令:
from vtk import QVTKWidged
没有工作:
Traceback (most recent call last):
File "prueba.py", line 6, in <module>
from Ui_MainWindowVtk import Ui_MainWindow
File "/home/usuario/PRINCIPAL/MECANICA COMPUTACIONAL/Varios/VTK/Ui_MainWindowVtk.py",
line 59, in <module>
from vtk import QVTKWidget
ImportError: cannot import name QVTKWidget
如何在Python中使用QVTKWidget
?
答案 0 :(得分:0)
I have always used QVTKRenderWindowInteractor
when using VTK from Python. In fact, you can and should take the QVTKRenderWindowInteractor.py
source file that is found in the resulting Python wrappings folder, typically something like:
...Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py
of your VTK build and modify it to fit your needs.
I just checked and it looks like this file has been updated substantially from the last time I modified it, so try using it out of the box first.