[vtkusers] Using vtkLineWidget2 with PyQt
onatt at gmx.de
Mon Dec 18 02:45:00 EST 2017
I found a solution to my problem: The problem is obviously caused by
python's garbage collector. If I assign the vtkLineWidget2 to an
instance variable of the class MainWindow, it works as expected. The
same issue happens with other vtkWidgets, too.
I am interested to understand, why this actually happens. It is not a
problem for the vtkActor but only for the vtk...Widget. Something must
be fundamentally different between those classes which causes that the
vtk...Widget is garbage-collected although it is still needed by vtk.
Am 15.12.2017 um 12:02 schrieb Oliver Natt:
> Dear vtkusers,
> for some reason, I cannot manage to get a vtkLineWidget2 working in
> one of my PyQt-applications. Interestingly, the same code works well
> in a regular vtk-window. Please find attaced two python scripts. The
> first script "linewidget2_noQt.py" works exactly as expected: A yellow
> cylinder and the line widget is rendered. I can also interact with the
> widget by dragging the endpoints with the mouse. However, the same
> code embedded into a Qt-Window (cf. linewidget2_qt.py) does not work:
> The yellow cylinder is shown, but the line widget is missing.
> Do you have any suggestions how to get the vtkLineWidget2 working in a
> Best regards,
> Powered by www.kitware.com
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers