# QML Rendering Problem

**URL:** https://discourse.vtk.org/t/qml-rendering-problem/7820
**Category:** Development
**Created:** [February 11, 2022, 9:16am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820 "2022-02-11T09:16:02Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![ltylight](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@ltylight](https://discourse.vtk.org/u/ltylight)
#### Post date: [February 11, 2022, 9:16am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/1 "2022-02-11T09:16:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 11, 2022, 9:23am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/2 "2022-02-11T09:23:26Z")

</div>

@lgivord @sankhesh

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

---

<div class="post-metadata">

### Author: ![yuvsaha123](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/b77776/32.png) [@yuvsaha123](https://discourse.vtk.org/u/yuvsaha123)
#### Post date: [February 18, 2022, 12:47pm UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/3 "2022-02-18T12:47:23Z")

</div>

> [@mwestphal](#):
>
> Your analysis is correct, QtQuick support is very new and will be improved over time.

thanks for the awesome information.

---

<div class="post-metadata">

### Author: ![Michael\_Jackson](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael_jackson/32/61_2.png) [@Michael\_Jackson](https://discourse.vtk.org/u/Michael_Jackson)
#### Post date: [February 18, 2022, 2:48pm UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/4 "2022-02-18T14:48:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ltylight](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@ltylight](https://discourse.vtk.org/u/ltylight)
#### Post date: [February 22, 2022, 2:52am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/5 "2022-02-22T02:52:02Z")

</div>

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

> **[GitHub - nicanor-romero/QtVtk: An integration between Qt Quick Controls 2 and...](https://github.com/nicanor-romero/QtVtk)**
>
> An integration between Qt Quick Controls 2 and VTK for 3D rendering - GitHub - nicanor-romero/QtVtk: An integration between Qt Quick Controls 2 and VTK for 3D rendering

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.

---

<div class="post-metadata">

### Author: ![ltylight](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@ltylight](https://discourse.vtk.org/u/ltylight)
#### Post date: [February 22, 2022, 3:00am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/6 "2022-02-22T03:00:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Michael\_Jackson](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael_jackson/32/61_2.png) [@Michael\_Jackson](https://discourse.vtk.org/u/Michael_Jackson)
#### Post date: [February 22, 2022, 4:47pm UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/7 "2022-02-22T16:47:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![edwardAllen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/edwardallen/32/4576_2.png) [@edwardAllen](https://discourse.vtk.org/u/edwardAllen)
#### Post date: [February 23, 2022, 7:43am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/8 "2022-02-23T07:43:23Z")

</div>

You can see my discourse  
[All Animation in widget not work when use vtk with Qml](https://discourse.vtk.org/t/all-animation-in-widget-not-work-when-use-vtk-with-qml/7630)

and this  
[Vtk9.1 for Qml with QQuickvtkrenderItem have some issues.](https://discourse.vtk.org/t/vtk9-1-for-qml-with-qquickvtkrenderitem-have-some-issues/7601/5)

---

<div class="post-metadata">

### Author: ![X\_Lee](https://discourse.vtk.org/user_avatar/discourse.vtk.org/x_lee/32/5234_2.png) [@X\_Lee](https://discourse.vtk.org/u/X_Lee)
#### Post date: [May 27, 2022, 7:36am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/9 "2022-05-27T07:36:30Z")

</div>

Hi, do we have any plan to fix this problem? IWill the fix happen in the next release ? We really need VTK view to display above Quick elements. Thanks~

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [June 1, 2022, 9:54am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/10 "2022-06-01T09:54:25Z")

</div>

From [https://discourse.paraview.org/t/how-are-features-and-bug-fixes-incorporated-into-paraview/4735](https://discourse.paraview.org/t/how-are-features-and-bug-fixes-incorporated-into-paraview/4735)

As with all open source projects, adding features and fixing bugs takes developer effort. That effort may originate from volunteer community contributors, or through paid professional services offered by companies like [Kitware](https://www.kitware.com). Features and bug fixes are prioritized by the needs of contributing community members and by professional services customers.

---

<div class="post-metadata">

### Author: ![John.Stone](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@John.Stone](https://discourse.vtk.org/u/John.Stone)
#### Post date: [December 10, 2022, 7:09am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/11 "2022-12-10T07:09:15Z")

</div>

You can try the QQuickVTKItem[.cpp/.h] from here: [GitHub - john-stone-ics/QuickVtk: rewrite of https://github.com/qCring/QuickVtk](https://github.com/john-stone-ics/QuickVtk)

It works much better.

---

<div class="post-metadata">

### Author: ![edwardAllen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/edwardallen/32/4576_2.png) [@edwardAllen](https://discourse.vtk.org/u/edwardAllen)
#### Post date: [December 14, 2022, 5:51am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/12 "2022-12-14T05:51:31Z")

</div>

Thanks so much ! 👍 👍 👍

---

<div class="post-metadata">

### Author: ![John.Stone](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@John.Stone](https://discourse.vtk.org/u/John.Stone)
#### Post date: [December 14, 2022, 7:58am UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/13 "2022-12-14T07:58:02Z")

</div>

Here is most up to date version:

> **[GitHub - john-stone-ics/QML-VTK-Examples: QML version of a selection of...](https://github.com/john-stone-ics/QML-VTK-Examples)**
>
> QML version of a selection of KitWare's examples. Contribute to john-stone-ics/QML-VTK-Examples development by creating an account on GitHub.

> <https://github.com/john-stone-ics/QML-VTK-Examples/blob/main/HighlightPickedActor/QQuickVtkItem.h>

---

<div class="post-metadata">

### Author: ![John.Stone](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@John.Stone](https://discourse.vtk.org/u/John.Stone)
#### Post date: [December 16, 2022, 5:01pm UTC](https://discourse.vtk.org/t/qml-rendering-problem/7820/14 "2022-12-16T17:01:13Z")

</div>

Pull Request  
[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/9763](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9763)
