QtQuick 2.0, plugins, and OpenGL rendering.

  • Hello all,

    I'm in the process of porting a quite big application from Qt 4.8.4 to Qt 5.1.1. This application consists of a front end in QML and a lot of plugins in C++. Among those plugins, one is doing OpenGL rendering in a shader.
    With Qt 4, we used the qmlviewer to run the application (with the -opengl switch), plugins were loaded and the OpenGL was rendered, all fine and dandy.
    Now with Qt 5, we tried the same scheme with qmlscene but it won't work anymore. It appears we don't have a (valid) opengl context in our plugins, that's why the rendering fails.
    Any hints on what we can do? The qmlscene doesn't have the -opengl switch as qmlviewer does, which tends to make me think we are doing it thing the wrong way (tm).

    Thanks in advance!

  • Sorry there is a typo here :
    "one is doing OpenGL rendering in a shader."


  • qmlscene is gl implicitly by default I believe, since it uses the scenegraph of qtquick2.

    without seeing any code, i can just say look at the qt5 qtquick examples, like "rendering in an fbo", "rendering under qml", etc.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.