Important: Please read the Qt Code of Conduct -

Scenegraph with OpenGL : Unwanted rendering

  • Hello everyone,
    My problem is quite simple. I was inspired by the scenegraph example of Qt with OpenGL to synchronize my 3D viewer made with VTK (GUI thread and QSGRenderthread). This synchronization is done through my QQuickWindow, the problem is that all the updates of a QML element result in a rendering of my 3D Viewer.

        QObject::connect(w, &QQuickWindow::beforeSynchronizing, this, &QQuickVTKRenderItem::sync,
          w, &QQuickWindow::beforeRendering, this, &QQuickVTKRenderItem::paint, Qt::DirectConnection);
        QObject::connect(w, &QQuickWindow::sceneGraphInvalidated, this, &QQuickVTKRenderItem::cleanup,

    However, for performance concerns, I want to control all the renderings of my viewer. Do you know how to fix this?
    Thanks for your help.

  • Is it possible to override the func update of the 3D viewer and do conditional update in this func?

  • @JoeCFD update() is a Qt signal so I can't overide it unfortunalety

  • @JoeCFD ah yes my bad, I tried to override it it was my first idea but Qt didn't really like it, I should have made a mistake. I'll try again thanks

  • @JoeCFD I was working on other stuffs but now I remember why I can't override QQuickItem update() method... it is a non-virtual slot, so it can't solve my rendering issues. I am still looking for a solution ...