Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Show qml elements on top of custom qglwidget viewport
Forum Updated to NodeBB v4.3 + New Features

Show qml elements on top of custom qglwidget viewport

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ecripes
    wrote on 23 Jul 2012, 16:50 last edited by
    #1

    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.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      z.emb
      wrote on 30 Oct 2012, 16:02 last edited by
      #2

      Have you found a solution for this problem?

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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved