Show qml elements on top of custom qglwidget viewport



  • I create an instance of a class derived from QGLWidget, and set this instance as the viewport on a QDeclarativeView:
    @int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QDeclarativeView view;
    MyGLWidget glwidget; // QWidget
    view.setViewport(&glwidget);
    view.setSource(QUrl::fromLocalFile("main.qml"));
    view.show();
    return app.exec();
    

    }
    @
    OpenGL code is correctly displayed inside the qml view, but the problem is that any qml elements (like Rectangle) will appear beneath the viewport. I have found very little info in docs about qdeclarativeview::setViewport, except that it comes from QAbstractScrollArea. I am looking for a way to have the viewport widget always appear beneath any QML elements.



  • Have you found a solution for this problem?

    I was trying the same thing, with the same result.


Log in to reply
 

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