Priority: P1: Critical
Affects Version/s: 5.15.0, 5.15.1
Fix Version/s: None
Component/s: GUI: OpenGL
Environment:Windows 10 2004, Visual Studio 2019, Qt 5.15.1 build from Git repo
If a QGLWidget is part of a widget hierarchy that is created dynamically at runtime, the QGLWidget will be bad when the parent of the hierarchy is not on the primary screen.
The bad QGLWidget will not fit into its surrounding widgets and positions returned by mouse events have an offset.
The issue can be avoided with either
- placing the parent widget on the primary screen before creating the widget hierarchy or
- passing an already visible widget as parent in the QGLWidget constructor and use setParent() afterwards to assign the correct parent
The root cause seems to lie deep in the Qt internals, maybe in WindowCreationData::create().
I attach the source of an example program to reproduce the error, plus some additional information in the .7z file.
Reference: INC-1511632 (related)
Error is visible especially in the lower right corner of the QGLWidget.