Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QGLWidget with child widgets

    General and Desktop
    3
    3
    5816
    Loading More Posts
    • 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.
    • F
      floof last edited by

      Hello,

      I'm currently developing a 3D application with Qt's QGLWidget.

      I'm having trouble getting some widgets drawn over the QGLWidget.

      What I did is:

      • Create a designer QMainWindow form
      • Put a QWidget as central widget
      • Add child widgets to the QWidget, so they are drawn above
      • Promote the QWidget to my own QGLWidget subclass

      But this leads to child widgets's backgrounds to not be drawn nor refreshed. What I'd like to happen is to have the child widgets drawn over GL rendering, with transparent background.

      I've seen solutions using a QGraphicsView and QGraphicsScene, but they are applied programmaticaly, and I'd prefer everything to be managed through the designer.

      Is there any way to get the QGLWidget children drawn over the OpenGL scene with transparent background ?

      Thanks in advance for your help.
      Floof.

      1 Reply Last reply Reply Quote 0
      • W
        wisty last edited by

        Hi,
        Did u resolve this problem?

        1 Reply Last reply Reply Quote 0
        • R
          r2d3 last edited by

          Hello Floof,

          one solution is to use the mechanics of QGraphicsScene/View to embed widgets in a scene :
          http://doc.trolltech.com/qq/qq26-openglcanvas.html

          Here, you have an example of doing OpenGL in the drawBackground of the Scene.

          Another way is to overpaint with a QPainter over your OpenGL scene :
          http://doc.qt.nokia.com/4.7/opengl-overpainting.html

          I think embedding directly over QWidget in a QGLWidget is problematic.

          Regards.

          David

          1 Reply Last reply Reply Quote 0
          • First post
            Last post