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. Layering a QGLWidget on top of a qwidget
Forum Updated to NodeBB v4.3 + New Features

Layering a QGLWidget on top of a qwidget

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.8k 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.
  • C Offline
    C Offline
    caleb k
    wrote on last edited by
    #1

    I'm writing what is essentially a multi-trace oscilloscope viewer. It appears that the most efficient way to draw the traces of the signal is to use raw OpenGL draw commands, i.e., in my paintGL() :

    @glEnableClientState(GL_VERTEX_ARRAY);
    glVertexPointer(2, GL_FLOAT, 0, data.constData());
    glDrawArrays(GL_LINE_STRIP,0,data.size()-1);
    glDisableClientState(GL_VERTEX_ARRAY);@

    Ideally, I want to have the borders and tick marks for this line (which is constantly moving) drawn in a QWidget that lives below the qglwidget. However, I can't seem to get this to work. If I don't make the QGLWidget draw a background, I see through to my desktop underneath. Any hints at how to stack a transparent QGLWidget on top of a QWidget?

    thanks!

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      Why not just use OpenGL to also draw the borders and tick marks?

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • C Offline
        C Offline
        caleb k
        wrote on last edited by
        #3

        That's the current implementation, but it ends up being somewhat klugy. Ideally, I'd like to make the background stuff easily modifiable/"skinable".

        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