Skip to content

Fix transparent rendering of the cube

Friedrich W. H. Kossebau requested to merge work/kossebau/fixblend into master

QOpenGLWidget::paintGL() docs hints that only certain things are reset, which does not include the blending.

So any blending functions set are just by chance, and some recent changes in Qt code might now leave other state behind. E.g. the last thing Kubrick's code does is painting the labels, and QPainter font rendering sets the blending src/dest pair to GL_CONSTANT_COLOR, GL_ONE_MINUS_SRC_COLOR. Which then on the next invocation of paintGL() is still set at least with Qt 6.7.0. Resulting in undesired transparent display of the cube (and background).

BUG: 486085 FIXED-IN: 1.7.24050

Would backport to release branch afterwards.

@aacid

Other option might be to just glDisable(GL_BLEND); which should effectively mean the same. But it seems blending enabled seems a usual thing by my search engine hits, and internally even might result in same code path for the default ONE & ZERO parameters.

Edited by Friedrich W. H. Kossebau

Merge request reports