Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Possible to have web view on top of OpenGL widget.
Forum Updated to NodeBB v4.3 + New Features

Possible to have web view on top of OpenGL widget.

Scheduled Pinned Locked Moved General and Desktop
qtwebengineqtwebviewopengl
1 Posts 1 Posters 1.4k 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.
  • P Offline
    P Offline
    pwhite
    wrote on 25 Jun 2015, 03:33 last edited by
    #1

    I have a Qt application which uses a QGLWidget to start a window and load an openGL application. All drawing is done with pure OpenGL in this application right now.

    I am hoping to figure out a way to integrate and overlay a Web view (of some sort) over the OpenGL context. Ideally I can just have the new widget be on top of the OpenGL context, but if that is not possible I suppose I could resize the OpenGL context (say to half the window width) and have the Web on the other half.

    Anyways, I have tried the following, and all I got was a white screen (but strangely if I click and drag I can copy the correct text out).

        QMainWindow window;
        QGraphicsView* viewp = new QGraphicsView();
        window.setCentralWidget(viewp);
        window.show();
        viewp->setScene(new QGraphicsScene(viewp));
    
        MyGLWidget* gl = new MyGLWidget();
        viewp->setViewport(gl);
        gl->show();
    
        QGraphicsWebView web view;
        webview.load(QUrl("http://qt.io"));
        viewp->scene()->addItem(&webview);
    

    If I don't add the QGraphicsWebView, then I do see the OpenGL context, but rendered terribly. To me this means that a GL widget cannot be drawn inside a QGraphicsView. I have looked around quite a bit for ways to do this and haven't come up with anything useful.

    FYI, I am using Qt5.4 right now, and am willing to look at the 5.5 rc1 release. I also don't have a preference between QWebView and QWebEngine.

    Any pointers?

    1 Reply Last reply
    0

    1/1

    25 Jun 2015, 03:33

    • Login

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