Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
Description
Reproducer attached. The ParentWidget is going to show a ChildWidget and a QWidget. By the default design, the QWidget should be on top. So when one build and launch the reproducer, it's going to show a red window above everything - the ChildWidget, the QPushButton, the ParentWidget itself.
But if one clicks the "Cause the problem" QPushButton (partially covered by red QWidget to show the expected stacking order), the stacking order is messed up. The red QWidget goes to the bottom, even under the ParentWidget. And what the button does is simply creating a QOpenGLWidget show it, hide it, and then destroy it. So at the end, that QOpenWidget is as good as neve existed. But somehow, the stacking order is messed up.
Some workarounds:
1. Use QWidget instead of QOpenGLWidget, i.e. changing m_temp to a QWidget. And this is the main reason that I think it is a bug, that QOpenGLWidget should not behave differently than QWidget in aspect of stacking order.
2. Do not parent QOpenGLWidget to anything, i.e. m_temp = new QOpenGLWidget;
3. Do not make QWidget a window, i.e. comment out "m_topmost_child->setWindowFlags(Qt::Window);".
BTW, creating a new QOpenGLWidget and deleting it appears to destroy the ParentWidget and then recreate it (one can clearly see disappearing and reappearing), but it actually does not. I've implemented a debug output in its destructor, but it is never triggered.
And although the "symptoms" are different, this problem may be related to QTBUG-134713. The reproducer is a modified version of that for QTBUG-134713, and the workarounds are quite similar too. Both are about windowing issues of a QOpenGLWidget.
Attachments
Issue Links
- relates to
-
QTBUG-134713 QOpenGLWidget seems to mess up mouse events even though it is deleted
-
- Reported
-