[vtkusers] crash after switching to vtk6 release mode (from vtk5) of QVTKWidget

curator curator at gmx.de
Fri Aug 16 08:50:11 EDT 2013


Dear all,

I have quite a huge User Interface constructed with qt4 und vtk5 by 
basically using the QVTKWidget for showing the vtk stuff.

In order to be up-to-date, I decided to port my code to qt5 and vtk6. 
After trying to build the libraries from source, I finally got a working 
version without to much modifications of my code.

I am working in windows with VS2010 and everything works now in debug 
mode. Unfortunaly, as soon as I build my code in release mode, my gui 
crashes as soon as qt tries to add the vtk widget. Well, as I said, it 
is quite a huge amount of code an it is really hard to write an minimal 
example, especially with qt.

Therefore, I add the first part the constructor of my class that 
directly inherits from QVTKWidget
> My_Widget::My_Widget(QWidget  *i_Parent):QVTKWidget(i_Parent)
> {
>     m_vtkRenderWindow = vtkRenderWindow::New();
>
>     this->SetRenderWindow(m_vtkRenderWindow); // (*)
>
>     m_vtkRenderer = vtkRenderer::New();
>
>     m_vtkRenderWindow->AddRenderer(m_vtkRenderer);
>
>     vtkEventQtSlotConnect *t_connections = vtkEventQtSlotConnect::New();
>     t_connections->Connect( this->GetRenderWindow()->GetInteractor(),
>                               vtkCommand::RenderEvent ,
>                               this,
>                               SLOT(render()));

When I add this widget to the GUI with
> m_MainLayout->addWidget(m_VTKWidget);
that is exactly the line where the code crashes. After commenting out 
the constructor starting from line // (*), the widget can be added, but 
crashed afterwords. So I guess I would start investigating here, but I 
have no further idea.

Does anyone have a good idea to start?

I would be happy to debug, but as I said, the crash does not occur in 
debug mode.

kind regards,
curator



More information about the vtkusers mailing list