[PyQt] VTK in PyQt
Gib Bogle
g.bogle at auckland.ac.nz
Tue Mar 9 04:27:37 GMT 2010
Gib Bogle wrote:
> OK, I located QVTKRenderWindowInteractor.py. I'll see if I can figure
> out how to use it.
Not much success here. I can run the example QVTKRenderWidgetConeExample() from
within my Qt GUI program, and it creates its own render window, independent of
the Qt window. I haven't managed to find out how to create a render window for
the VTK code within Qt Designer. I did find some tantalizing suggestions here:
http://www.vtk.org/pipermail/vtkusers/2009-May/101003.html
but I'm too ignorant to be able to follow them. The followup poster says:
"I lay out everything in Designer, just as I do when using C++,
including placing a QVTKWidget in the GUI. Then, after I save the .ui
file, instead of just running pyuic4 on that .ui file, I run a little
python script which does that plus makes a couple substitutions in the
resulting .py file. By doing this I don't have to add the
QVTKRenderWindowInteractor separately in my main python program."
Since I have no way to place a QVTWidget in the GUI, this doesn't help much. I
gather that this requires QVTKWidgetPlugin.dll, but that doesn't seem to be part
of my PyQt4 distribution, nor part of VTK. Maybe you have to build it yourself.
Any helpful suggestions will be gratefully received.
Gib
More information about the PyQt
mailing list