[vtkusers] QVtkWidgets in a QGraphicsView (QGraphicsScene)

Clinton Stimpson clinton at elemtech.com
Tue Mar 17 11:35:12 EDT 2009


You'll have to handle those events yourself.
When using QGraphicsView, you'll have to decide whether to pass the 
event to VTK for the background image, or let the event take its default 
path to any items on top of the background image.
Forwarding them to the QVTKWidget doesn't work because QGraphicsView 
installs an event filter to intercept them.
I think a helper class would be nice that takes any QEvent and passes 
the info down to the vtkRenderWindowInteractor.
QVTKWidget could be changed to use the helper class, and it could also 
be used in that vtk/qtgraphicsview example.
I've got most of that code already, and if you want to help finish it, 
let me know.

Clint

J.S.Wijnhout at lumc.nl wrote:
> Clinton Stimpson wrote:
>   
>> Yes, you need the CVS version of VTK to run that example.
>>     
>
> Indeed, the example runs fine with the CVS version. However interacting with the render window does not work. I tried to forward events from the QGraphicsView to the QVTKWidget, but somehow only the key press event arrive at the QVTKWidget. Perhaps I'm asking too much from Qt's graphics system.
>
> Best,
> Jeroen
>
>
> J.S.Wijnhout at lumc.nl wrote:
>   
>> Hi,
>>
>>   
>>     
>>> There is now an example in VTK/Examples/GUI/Qt/GraphicsView you might be interested in.
>>>     
>>>       
>> Sounds like an interesting example!
>>
>>   
>>     
>>> Contributions to improve it are welcome. 
>>>     
>>>       
>> It can't seem to get it to work properly (using Qt 4.4.3 and VT 5.2.0). When I run the example the standard vtkRenderWindow is displayed but the Qt widget doesn't show. Also I get many errors on the console (see at the end of this message). Should I use the CVS version of VTK?
>>
>> Best,
>> Jeroen
>>
>>     
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   




More information about the vtkusers mailing list