[vtkusers] Qt4 - adding a QVTKWidget to QMdiArea nulls the render window of the renderers

John Platt jcplatt at dsl.pipex.com
Wed Dec 12 08:24:06 EST 2007


Hi,

 

Creating a QVTKWidget derived object, something like 

 

class MdiChild : public QVTKWidget

{

    MdiChild() {   ren = vtkRenderer::New();

                       GetRenderWindow()->AddRenderer( ren ); .... }

   ...

}

 

and adding to a QMdiArea::addSubWindow() nulls the render window
associated with the renderer (ren->GetRenderWindow()). This causes other
vtk objects which get the render window from the renderer to crash (eg.
vtkOrientationMarkerWidget).

 

It appears that QMdiArea::addSubWindow() reparents the MdiChild.
QEvent::ParentAboutToChange is trapped by QVTKWidget::event which
eventually calls vtkWin32OpenGLRenderWindow::Clean() where

      ren->SetRenderWindow(NULL); occurs.

 

The QEvent::ParentChange doesn't reset the render window for the
renderer list.

 

I don't pretend to understand what should happen. Perhaps
GetRenderWindow() should not be called until after addSubWindow() or
QEvent::ParentChange should add the render window back to each renderer.

 

Any advice or suggestions would be very much appreciated,

 

TIA

 

John.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071212/7f01702b/attachment.htm>


More information about the vtkusers mailing list