Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.2
-
None
-
Windows 11, Qt 6.5.2, Nvidia Quadro 2000
Description
QSurfaceFormat::setDefaultFormat value (at least the multi-sampling part) is forgotten after re-parenting an QOpenGLWidget. This can be reproduced, using the hellogl2 example. We modified the example and hardcoded a multisampling value of 4:
fmt.setSamples(4); // hardcode multisampling for bug report
QSurfaceFormat::setDefaultFormat(fmt);
The source code is available here:
After start of the example, the multisampling works like expected:
After Undock-Dock cycle, the multisampling is broken:
So application that use docking systems such as the Qt Advanced Docking System where widgets are reparented will see this issue. We use the Qt Advanced Docking System with the coin3d library and see this issue. In Qt5 this works properly using the following code
#if QT_VERSION <= QT_VERSION_CHECK(6, 0, 0) QGLFormat format; format.setAlpha(true); format.setSampleBuffers(true); QGLFormat::setDefaultFormat(format); #else
For the hellogl2 example we implemented a work around hack - you can get it here:
I think, the bug is related or the same like this one: QTBUG-59152