PDA

View Full Version : QGLWidget: Draw 100% of image (even when hidden)



JohnnyRep
10th April 2010, 15:09
Hey!

I am using a QGLWidget displayed in a QMdiSubWindow. Now it can happen hat other subwindows are on top of the QGLWidget or the widget is hidden / minimized.

Is it possible to make the QGLWidget drawing 100% of the widget-content? The images are send over a TCPsocket to an embedded system. So I have to make sure that the picture that was send to the remote system is not broken (subwindows overlaying parts of the widget) or old (QGLWidget hidden -> no new images)

I thought that this is a common question, but I couldn't find any similar topic in the forum so far.

J.R.

JohnnyRep
12th May 2010, 15:24
In the end I "solved" it by not using a Qt class.
Does anybody know whether offscreen rendering is possible with Qt?
Just a Qt-Class generating images and storing them in a buffer / pixmap etc.

There are many results when you ask google about that topic, but so far there was no build in solution. Just some dirty workarounds etc.

SixDegrees
12th May 2010, 16:55
You can paint directly onto a QImage object. You can then use QPainter's drawImage() function to "blit" the image onscreen.

Wali
13th May 2010, 00:37
Have you tried QGLWidget's renderPixmap(int,int,bool)

Wali
8th June 2010, 20:09
Does anybody know whether offscreen rendering is possible with Qt?

Yes it is very possible and real. I've had success render off screen by rendering into a QGLFramebufferObject. Not only that. I prefer this method to render content (images) because QGLWidget::renderPixmap often requires a new QGLContext and sharing the context has not be reliable for me. Plus, you can use existing display lists and vbos.

Bottom Line render in to a QGLFramebufferObject or a QGLPixelBuffer if you want render off screen. No need to create new display lists or worry with context stuff.

Hope this Helps :cool:

kachhadiyatushar
28th January 2016, 14:46
Hello,

I am new to QOpenGLWidget and using OpenGL ES 2.0. I have been trying to display the camera captured frame in QOpenGLWidget but it shouldn't works just getting blank screen, The captured image is good but opengl window is not updating the frame just blank screen I have used QGLWidget for frame display with QT 5.2.1. Now I am trying to port it to Raspberry pi and it has ES 2.0 API and QT 5.4.1 QOpenGLWidget.

Thanks

Tushar Kachhadiya