diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2017-06-06 23:46:06 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-07 14:49:13 +0000 |
commit | 0265a23bb02b68534bb3c86514cc93bc45a7444f (patch) | |
tree | 138a1b5c61ffbe12d82419cd78a117962e5ed4ef /tests | |
parent | e8ea1edd89729d4caeffa70dd8cf76a686294987 (diff) |
Fix crash when calling QWidget::grab() on a QOpenGLWidget
By avoiding unneeded nested QPainters.
Crash was:
ASSERT: "s" in file /data/sources/qt/qt5/qtbase/src/gui/painting/qpaintengine_raster.cpp, line 2239
s was nullptr because the inner QPainter had called updateState(0), which is then dereferenced by the outer QPainter.
Task-number: QTBUG-61036
Change-Id: I7aad648f805f1abac4d38dfbefa2292da8b52af4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index 5980cb95d0..f51c566f20 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -233,6 +233,8 @@ void tst_QOpenGLWidget::painter() glw->m_clear = true; image = glw->grabFramebuffer(); QVERIFY(image.pixel(20, 10) == qRgb(0, 255, 0)); + + QPixmap pix = glw->grab(); // QTBUG-61036 } void tst_QOpenGLWidget::reparentToAlreadyCreated() |