vtk-9 with QML - examples?

I wrote an application that defines user controls with QML (Qt-5.14), and displays polygonal surface data with VTK-8.2. My software uses the approach described here, extending QQuickFrameBufferObject which runs in the main thread, and QQuickFrameBufferObject::Renderer, which runs in the render thread. I need to upgrade to vtk-9, but unfortunately my application no longer displays the surface data when built with vtk-9.0. Specifically when my renderer calls vtkGenericOpenGLRendererWindow::Render(), the window’s MakeCurrent() call always fails. Why would MakeCurrent() work with vtk-8.2 but fail for vtk-9.0? I asked for help on this forum about a week ago, but haven’t received a response yet.

My code is here:

But perhaps I’m using the wrong approach - does VTK actually provide a working example or test case of what I am trying to do, that works with vtk-9?


This problem is apparently due to a bug in vtk-9.0, as my application now works with vtk-9.2. Note that per advised in vtkGenericOpenGLRenderWindow documentation, my code installs a callback that asserts the window as current when MakeCurrent() is called:

  // Invoke callback when renderWindow_ is made current
                             this, &QVtkRenderer::makeCurrentCallback);

And the callback does this:

/// Assert renderWindow_ as current in response to WindowMakeCurrent event
void QVtkRenderer::makeCurrentCallback(vtkObject *, unsigned long eid,
                                       void *callData) {

  std::cout << "makeCurrentCallback()!" << std::endl;

  // Assert render window as current