[vtkusers] Python Wrapper Vtk

David Gobbi david.gobbi at gmail.com
Wed Oct 28 17:18:02 EDT 2015


Hi Pedro,

Instead of using the QVTKWidget (which is written in C++), use
the QVTKRenderWindowInteractor (which is written in Python)

from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor

 - David


On Wed, Oct 28, 2015 at 3:05 PM, Pedro Paulo <pedropaulobmjr at hotmail.com>
wrote:

> Hello, I'm trying to make a GUI using Qt 4 with Vtk, as a test, I started
> doing a simple window and put the QVTKWidget using Qt Designer, I used the
> pyquic4 and did my python file, however when I try to compile it, there is
> the following error:
>
> Traceback (most recent call last):
>    File "viv.py", line 40, in <module>
>      from QVTKWidget import QVTKWidget
> ImportError: No module named QVTKWidget
>
> I saw on the internet that the QVTKWidget is not a module, but a class of
> vtk module, but when I change the code and try again the following occurs:
>
> Traceback (most recent call last):
>    File "viv.py", line 40, in <module>
>      from vtk import QVTKWidget
> ImportError: cannot import name QVTKWidget
>
> Does anyone know the solution to this?
> I thank the attention.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151028/fbf394b3/attachment.html>


More information about the vtkusers mailing list