Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.2
Description
Reproducer attached. It features a transparent root QWidget with 2 sub widgets. From top to bottom:
1. A 600x300 webWidget that contains a 400x300 QWebEngineView.
2. A 600x300 labelWidget that contains a 400x300 QLabel.
The design is that there is 200x300 transparent area to the right of both QWebEngineView and QLabel. To reproduce the problem, build the reproducer against 6.8.2 and one will see:
The labelWidget on the bottom is all good that the transparent part stays transparent. But for webWidget, somehow the transparent part is rendered in black.
The problem is native widget:
labelWidget->setAttribute(Qt::WA_NativeWindow);
Although it is set to labelWidget, everything becomes native at the end. And somehow, webWidget cannot handle native transparent background correctly. And since labelWidget is not affected, I think it is due to QWebEngineView.
BTW, the problem can be also triggered by calling winId(), which is essentially making everything native too. And somehow "Qt::WA_DontCreateNativeAncestors" doesn't work. One can do
labelWidget->setAttribute(Qt::WA_DontCreateNativeAncestors);
before calling winId() or setAttribute(Qt::WA_NativeWindow). It doesn't change anything. And "root->testAttribute(Qt::WA_NativeWindow);" still reports "true".