Important: Please read the Qt Code of Conduct -

Render Qt Quick to FBO

  • Hi,

    I would like to render Qt Quick/QML 2.0 directly to a FBO and use that as an overlay over a 3D scene in a QGLWidget. As it is not yet possible to mix QQuickView and QWidgets, that is my best option as far as I can see.

    How can I achieve this? I see QQuickWindow has a setRenderTarget(QOpenGLFrameBufferObject*), but how can I load a QML file and render it to a FBO without ever showing the window to screen?

    Are there any code examples/tests that show how to do it?

    I've tried to search for this, but I only found a code snippet using QQuickCanvas, but it seems that QQuickCanvas is not available in Qt5. Is that right?


  • Could you post the code snippet using QQuickCanvas? I'm also trying to render Qml to a FBO.

Log in to reply