From 281ee04a825c4d4ba4ca88929ee572df0d1a4cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 15 Aug 2023 21:49:03 +0200 Subject: [PATCH] embeddedwindows: Mask the painting manually by applying a clip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QWindow::setMask() is not guaranteed to turn the masked out areas transparent, and it's up to the client to ensure this during painting. Change-Id: I1155b3ad095152a993532f2290cacb670e20daa7 Reviewed-by: Liang Qi Reviewed-by: Tor Arne Vestbø (cherry picked from commit 5ce4aecd495667a50dd121930f9ca39dc07cfc36) Reviewed-by: Qt Cherry-pick Bot --- tests/manual/embeddedwindows/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/manual/embeddedwindows/main.cpp b/tests/manual/embeddedwindows/main.cpp index 98f40e358c6..904839cfa3b 100644 --- a/tests/manual/embeddedwindows/main.cpp +++ b/tests/manual/embeddedwindows/main.cpp @@ -33,6 +33,8 @@ protected: { QPainter painter(this); painter.setCompositionMode(QPainter::CompositionMode_Source); + if (!mask().isNull()) + painter.setClipRegion(mask()); painter.fillRect(QRect(0, 0, width(), height()), m_pressed ? QGradient(QGradient::JuicyPeach) : m_brush); }