May 7, 2011

caleb k caleb k
Lab Rat
2 posts

layering a QGLWidget on top of a qwidget

 

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() :

  1. glEnableClientState(GL_VERTEX_ARRAY);
  2. glVertexPointer(2, GL_FLOAT, 0, data.constData());
  3. glDrawArrays(GL_LINE_STRIP,0,data.size()-1);
  4. 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!

2 replies

May 7, 2011

ZapB ZapB
Robot Herder
1354 posts

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

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

May 7, 2011

caleb k caleb k
Lab Rat
2 posts

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

 
  ‹‹ [Solved] The Qt classwizard example can’t display image under windows7      Icons at the menubar not visible in Ubuntu 11.04 ( Unity ) ... ››

You must log in to post a reply. Not a member yet? Register here!