path: root/src/opengl/qgl_qpa.cpp
diff options
authorLaszlo Agocs <>2013-12-30 17:09:12 +0100
committerThe Qt Project <>2014-01-06 12:57:20 +0100
commitbd5cea5ba8458ab3d34700999654dbd7d7174084 (patch)
treebb11017789766816742dab61d1b1e0d2436fea6a /src/opengl/qgl_qpa.cpp
parent63fd793fc32a8dd85a6d6ce1cfe3811ff99888f5 (diff)
Resurrect QGLWidget::renderPixmap()
This function has been completely broken since Qt 5.0. Unfortunately the autotest's verification steps were somewhat faulty so returning a null pixmap from renderPixmap() did not trigger a failure. The implementation is now done with framebuffer objects and pixel readback. This is not ideal performance-wise, but is the only option. In Qt 4 pixmaps were often backed by platform dependent native pixmaps that could be used as rendering targets for OpenGL content. This is not an option anymore since pixmaps are raster backed on all the major platforms. Task-number: QTBUG-33186 Change-Id: I8f558e33bf7967ac3be439fd5a3eac07b6444be5 Reviewed-by: Jørgen Lind <>
Diffstat (limited to 'src/opengl/qgl_qpa.cpp')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 6e698bf939..8b66c891bb 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -138,6 +138,9 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
if(!d->paintDevice || d->paintDevice->devType() != QInternal::Widget) {
+ // Unlike in Qt 4, the only possible target is a widget backed by an OpenGL-based
+ // QWindow. Pixmaps in particular are not supported anymore as paint devices since
+ // starting from Qt 5 QPixmap is raster-backed on almost all platforms.
d->valid = false;
}else {
QWidget *widget = static_cast<QWidget *>(d->paintDevice);