PDA

View Full Version : QGLWidget Render Text in the foreground



arpspatel
11th April 2010, 00:36
Hi,

I have a QGLWidget which displays Webcam video, i want to be able to display the text in the right corner with the name and some information with it. I tried using renderText(...) but it doesnot display anything or maybe it displays but is behind the video.. as there is constant change in the scene rendering the text may be over written...

is there anyway i can add like a layer over the scene and display the text?

Thanks

JohannesMunk
11th April 2010, 11:35
Hi there!

How do you paint the webcam video? As a low-level dynamic opengl-texture or as some QGraphicsItem with a custom paint? Show us some code!

Either way, all you have to do is provide opengl a correct depth/z-value for both your video and the text.

How to do that with a QGraphicsScene (draw the video in its background), you might want to look at qt's boxes demo.

Johannes