They are use qt createRenderer() and createFramebufferObject() to create Vtk in qml. And this method is avaliable in Vtk 8.2 , but can not use in version after vtk 9.1.
After use official method of using vtk with qml suck like qquickVtkRenderWindow and other method such like qt::createRenderer() , I think use qt::createRenderer() is the best way to use vtk in qml . but after 9.x , this method can not used anymore ,
@edwardAllen, It might be related to differences in how the OpenGL context is set up in Qt and VTK.
Hard to say without actually looking into it. Since you had it working at some point, you could use git bisect to figure out the change that broke it.
I had see the different between vtk 9.2 and vtk 8.2 , and I had changed some thing to make program running , but it show nothing , and I cannot figure out where the bug is . Here are a demo by using this method , hope you can see it . testViewerWithFrameBuffer.zip (37.6 KB)
I had checkout many method to use vtk with qml , but after update vtk to 9.x , official give a qquickVtkRenderWindow dem it have many bugs when use it with qml , and if I back to use method
useful in vtk 8.2 , that method qt::createRenderer() not working with 9.x , so , until 9.2 , here are still not have a suitable method, I think qt::createRenderer() maybe a good method. , but I cannot fix the issue show nothing…
We did some work on a project in mid 2021 that had tried to fix a lot of these issues. Not sure if we ever put in a PR for it or not. Those commits have some of that work. We got a lot of VTK working nicely with QML. Ultimately we ended up dumping QML for other reasons and went back to widgets.
I think we were mainly editing the example code to get VTK working with QML. You can take a look at that code and see if any of it is still relevant.
Did you manage to find a solution? I just migrated a qml/VTK viewer based on QQuickFramebufferObject from VTK 8.2 to VTK 9.2.5 and I’m in the dark ie I have black screen because nothing is rendered.
Hello @kenavolic
ist it possible to get the full QVTKFramebufferObjectRenderer class? with your changes? Or do you have a github repo, where one can get it?
I am trying to get the qml-vtk-python project to work in python, and it could be that i am struggle around with the same problem that you did.
I tried changing the posted includes/excludes, but i didnt get it working in cpp => All I see is just a short flickering of the qt window and then it crashes. The debugger tells me it is a Segmentation fault, because of any QEvent.