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

curator curator at gmx.de
Fri Aug 16 10:24:55 EDT 2013


I just started trying around randomly, which typically doesn't help, but 
I found the behaviour to be even more strage:

Everything works find with this line:
m_VTKWidget->show();

but crahes with:
m_MainLayout->addWidget(m_VTKWidget);

In other words: Placing the (inherated widget of) QVTKWidget in an 
seperate Window works fine, but placing it in a part of an existing 
Widget (with buttons and stuff) does not work.
I tested: It works in debug mode and in linux.

any ideas?

regards,
curator

Am 16.08.2013 14:50, schrieb curator:
> 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
> _______________________________________________
> 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