path: root/tests
diff options
authorLaszlo Agocs <>2013-12-30 17:09:12 +0100
committerThe Qt Project <>2014-01-06 12:57:20 +0100
commitbd5cea5ba8458ab3d34700999654dbd7d7174084 (patch)
treebb11017789766816742dab61d1b1e0d2436fea6a /tests
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 'tests')
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 38c92c7610..1ec1d88802 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -1380,12 +1380,13 @@ void tst_QGL::glWidgetRenderPixmap()
RenderPixmapWidget *w = new RenderPixmapWidget;
- QPixmap pm = w->renderPixmap(100, 100, false);
+ QSize pmSize = QSize(100, 100);
+ QPixmap pm = w->renderPixmap(pmSize.width(), pmSize.height(), false);
delete w;
QImage fb = pm.toImage().convertToFormat(QImage::Format_RGB32);
- QImage reference(fb.size(), QImage::Format_RGB32);
+ QImage reference(pmSize, QImage::Format_RGB32);
@@ -2011,6 +2012,7 @@ void tst_QGL::textureCleanup()
QGLWidget w;
+ QTest::qWaitForWindowExposed(&w);
// Test pixmaps which have been loaded via QPixmapCache are removed from the texture cache