[vtkusers] QVTKRenderWindowInteractor Issue

JBK juk124 at psu.edu
Mon Feb 28 08:09:14 EST 2011


Hi,

I am developing visualization software that uses Qt and VTK.  I am 
creating a QVTKRenderWindowInteractor and adding this to a QWorkspace as 
the central widget of the application window.  Just as a note, I realize 
that QWorkspace is technically deprecated, but it's replacement QMdiArea 
does not seem to be able to handle a VTK render window as its widget.  
Anyway, the QWorkspace seems to be working just fine except for one 
annoying issue/bug.  Interaction that occurs within the render window 
seems to be shifted by about 35 pixels in the -y direction.  In other 
words, a mouse click is detected 35 pixels higher on the screen than 
where the glyph I am trying to pick is located.  The reason I know this 
is because I have added in a correction factor that shifts the mouse 
event by 35 pixels along the y axis and the pick event is then 
positioned correctly.

I have narrowed this issue down to possibly an issue with Qt's layout 
manager.  In other words, if I just create the render window and don't 
add it to a layout manager (just give it a parent window), the 
interaction seems to be correct.  However, when I add it to a layout 
manager so that it is resized according to its parent widget - which is 
what I need to happen - the 35 pixel interaction shift occurs.

Has anyone run into this issue or does anyone have any ideas for some 
creative fixes?  I need to fix this so that I can using other VTK 
widgets that require interaction such as the box probe.

Thanks,
Josh




More information about the vtkusers mailing list