Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.6.0, 5.15.0
-
None
-
Windows 7
Windows 10
Description
With the following code, the QWebEngineView window's background is not displayed transparently but in black when the window is set in full-screen display.
QWebEngineView view; view.page()->setBackgroundColor(Qt::transparent); view.setHtml("<html><div><p>Hello</p></div>" "<style type=\"text\/css\">body {font-size: 7em;color: red;}" "div {width: 100%;height: 100%;border: 25px solid blue;" "text-align: center;background-color: transparent;pointer-events: none;}" "</style></html>", QUrl("http://localhost")); view.setAttribute(Qt::WA_TranslucentBackground); view.setWindowState(Qt::WindowFullScreen); view.setWindowFlags(Qt::FramelessWindowHint | Qt::BypassWindowManagerHint); view.show();
If you comment out the line of "view.setWindowState(Qt::WindowFullScreen);", the transparent background was displayed correctly.
The issue is the same with QQuickWidget ( quickwidget.zip ):
QQuickWidget view;
view.setAttribute(Qt::WA_TranslucentBackground);
view.setClearColor(Qt::transparent);
view.setWindowFlags(Qt::FramelessWindowHint);
view.setWindowState(Qt::WindowFullScreen);
view.setResizeMode(QQuickWidget::SizeRootObjectToView);
view.setSource(QUrl("qrc:/test.qml"));
view.show();
Switching window by alt-tab makes it work. Probably refresh/repaint issue. It is not reproducible on Linux.