[vtkusers] vtkBorderWidget and vtkSeedWidget in QVTKWidget

Sam Raby rabysam28 at gmail.com
Tue Apr 29 14:48:48 EDT 2014


I was trying to get a vtkBorderWidget example working:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ImageClip

The example works fine in VTK, however when I wanted to use QVTKWidget in
Qt the vtkBorderWidget instant never appeared; A month ago, I had the same
issue when I wanted to use vtkSeedWidget.

After a lot of hours and several cups of coffee :), I came across 2-3
online posts such as this one:

http://vtk.1045678.n5.nabble.com/Using-VTK-widgets-in-Qt-renderers-tt1250231.html#none

and found out the problem is trivial, and it is only because the object
goes out of scope and hence vtkSmartPointer destroys it. One solution, for
me, was not-to-use vtkSmartPointer in this case, and remember to delete the
pointer in the end.

Just wanted to write this email for other people in future. Correct me if I
am mistaking in the above explanations. Maybe there is a better solution
too.

-Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140429/fe8c0d08/attachment.html>


More information about the vtkusers mailing list