Qt Forum

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

    Call for Presentations - Qt World Summit

    Layering a QGLWidget on top of a qwidget

    General and Desktop
    2
    3
    2562
    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.
    • C
      caleb k last edited by

      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 Reply Quote 0
      • Z
        ZapB last edited by

        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 Reply Quote 0
        • C
          caleb k last edited by

          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 Reply Quote 0
          • First post
            Last post