I’m porting our system from vtk7.1.1 to 8.2 and have been encountering several annoying issues.
We have multiple viewports each with a QVTKOpenGLNativeWidget.
Rendering works okay (with some issues with alpha) but I was getting crashes occasionally when removing vtkActors from the renderer.
Digging into it I found that QVTKOpenGLNativeWidgetObserver::Execute() in the case vtkCommand::WindowMakeCurrentEvent: was causing the crash. I presume that the context or the surface is invalid because it’s outside of the render call. I had no idea how to fix this except to use QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); before app initialization.
This doesn’t seem right. I’m wondering what could be done differently to make multiple QVTKOpenGLNativeWidgets work well.