QML Rendering Problem

Hi,
I use QT Qml as GUI framework and use VTK for 3D rendering. I tried QQuickVTKRenderWindow which is functional. However, I read the source code and it says ‘All the QtQuick element rendering is stacked visually above the vtk rendering’. This is extremely inconvenient to stack ui elements. I would like to ask if is there any schedule to fix this bug.
Or it’s actually not a bug but some nasty rendering pipeline issue between QML and VTK.
I checked QML documentation and it says QQuickFramebufferObject class is a convenience class for integrating OpenGL rendering using a framebuffer object (FBO) with Qt Quick. Is there any reason not using this class for VTK integration? Did you encounter some issue following QQuickFramebufferObject path?
Thanks, it would really helps a lot. I love VTK but I also want to use qml.

1 Like

@lgivord @sankhesh

Your analysis is correct, QtQuick support is very new and will be improved over time.

1 Like

thanks for the awesome information.

There will also be conflicts between the Vtk render thread, the gui Main thread and the QML rendering thread which need to be managed by you, the developer. One must be extremely careful about managing these threads or you will be artifacts and crashes in your application.

Thanks. We are trying to manage that. We found a project in github which works in vtk8 but not in vtk9.

The project works fine with vtk8 in rendering but has some flaw in GPU volume rendering and interaction. So now we are usingVTK8.2 + QT5.15, and we use vtk9 as a programming reference for interaction.
Currently it seems to work fine, but we haven’t test it much.
Hope it helps.

Thanks for the note. And apart from being careful, we have changed to a complete MVC framework, so that if qml+vtk fails, we can change it to qwidget+vtk.

We basically called a deferred rendering through a lambda that allows QML its time to do rendering, then hands over control to VTK for its rendering. It is a bit convoluted but is very stable in the end. If I had to do things over I never would have selected QML. I would absolutely stuck with QWidgets for a desktop application. 5.15 is missing stuff and 6.2 just isn’t ready for desktop. If you stick with QML there is a long road ahead of you for development. Just my 2 cents.

You can see my discourse
All Animation in widget not work when use vtk with Qml

and this
Vtk9.1 for Qml with QQuickvtkrenderItem have some issues.