summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api
diff options
context:
space:
mode:
authorAnu Aliyas <anu.aliyas@qt.io>2024-02-06 16:01:24 +0100
committerAnu Aliyas <anu.aliyas@qt.io>2024-02-12 15:39:27 +0100
commit5c73b7f5719b61aad1d7709fee3f810732bb3fba (patch)
tree2b13c08e9266bdc5c6cd2e1f753608dcf6ff9479 /src/webenginewidgets/api
parent01546dc701e8d21423b6ff31e3d684cc0df40eda (diff)
Fix for view displaying blank content with transparent background
For transparent background color, QtWebEngine will set the attribute Qt::WA_AlwaysStackOnTop to true. This change necessitates triggering an update on the top-level window. The code has been adjusted to invoke an update on the parent widget if one is present. Additionally, update is disabled while widget attributes are being updated, and re-enabled once all attributes are properly set. This prevents unnecessary updates and ensures the widget updates only after all values are set. Fixes: QTBUG-120273 Fixes: QTBUG-121227 Pick-to: 6.7 6.6 Change-Id: Id2a103a59e9dfeb98ac2245ec274360e3c65f239 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Moss Heim <moss.heim@qt.io>
Diffstat (limited to 'src/webenginewidgets/api')
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index c4a0da4d9..5aeeeb638 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -156,6 +156,7 @@ public:
}
void SetClearColor(const QColor &color) override
{
+ setUpdatesEnabled(false);
QQuickWidget::setClearColor(color);
// QQuickWidget is usually blended by punching holes into widgets
// above it to simulate the visual stacking order. If we want it to be
@@ -164,7 +165,8 @@ public:
bool isTranslucent = color.alpha() < 255;
setAttribute(Qt::WA_AlwaysStackOnTop, isTranslucent);
setAttribute(Qt::WA_OpaquePaintEvent, !isTranslucent);
- update();
+ setUpdatesEnabled(true);
+ window()->update();
}
void MoveWindow(const QPoint &screenPos) override
{