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. QGLWidget with child widgets

QGLWidget with child widgets

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 6.1k Views
  • 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 Offline
    F Offline
    floof
    wrote on last edited by
    #1

    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
    0
    • W Offline
      W Offline
      wisty
      wrote on last edited by
      #2

      Hi,
      Did u resolve this problem?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        r2d3
        wrote on last edited by
        #3

        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
        0

        • Login

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