Important: Please read the Qt Code of Conduct -

Rendering of OpenGL Textures or Scenes in a QML Window?

  • Hello,

    I am very new to the whole Qt-thing (began about 3 days ago) and I started a media-player as a learning project.

    My current problem is, that I want to display an OpenGL texture or scene (the video frames as a texture) in a QML Window.

    I tried the scenegraph approach, and as far as I understood it, it will "consume" a complete top-level window with all of the window's QML drawn in front of it.

    Since I want to create my own window frame and not use the window manager's this is not really an option (whatever I draw will be behind my QML aswell).
    I tried using 2 different top-level windows with one displaying my QML and the other drawing the scene graph, with the scenegraph-window always following the main window. -> THIS IS A MESS, and works only if the window manager supports transparency + does not blur transparent parts)

    I started trying with a custom QQuickPaintedItem, but havent gotten very far yet.

    My question: What is the best (and fastest) way to render an OpenGL texture or a scene in a QML element? Are there examples?

    Im gonna be able to provide more information when I get back home.

    Thank you!

  • Since editing doesnt work properly on mobile for me Im gonna add information I forgot as a reply:

    Qt/QML version: 5.5, QML2

    if relevant:
    development OS: debian amd64
    window manager: kwin

    -> developing in a vm (vmware)