Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.5, 6.6.2, 6.7.0 Beta3
-
Ubuntu 22.04 in Xorg mode, running in VMware Workstation 16.2.4 (Customer reported this on physical Ubuntu machines with Intel GPUs)
-
-
50c81f549 (dev), 2bbfa7f18 (6.7), 304666855 (6.6), b9df93fbb (tqtc/lts-6.5)
Description
Customer requirements
- The app grabs the contents of a QGraphicsView with a QOpenGLWidget viewport, containing standard QGraphicsItems as well as items that paint using direct OpenGL calls.
- The grab must work regardless of whether the QGraphicsView is visible on screen or not, even if it was never shown yet.
Problems
- The basic grabbing methods, using QGraphicsView::grab() or QOpenGLWidget::grabFramebuffer(), don't work – they are missing the OpenGL content.
- A workaround to the above was found: Add an additional "offscreen" QOpenGLWidget that renders the QGraphicsView in its paintGL method, and grab its framebuffer. This worked fine in Qt 5.15 and 6.2.
- In newer versions of Qt, this workaround no longer works.
To reproduce, build and run the attached project in Release mode, using Qt 6.2.11 first, and then using a newer version of Qt.
Expected outcomes (Qt 6.2.11)
Most tests will produce a green square and a coloured triangle on a white background (but the "viewport" method only works if the QGraphicsView was shown first)
Actual outcomes (Qt 6.5.5/6.6.2/6.7.0beta3)
The "viewport" method remains the same as before, but the "offscreen" method no longer captures the coloured triangle at all.