summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-08-15 21:49:03 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-12 21:40:12 +0000
commit281ee04a825c4d4ba4ca88929ee572df0d1a4cfd (patch)
treedde2053c2baabbf2ad2d1c95716cef4595b8629b
parent7e1321080c9bc1c779d9682bee8d95324a9878d1 (diff)
embeddedwindows: Mask the painting manually by applying a clip
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 <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 5ce4aecd495667a50dd121930f9ca39dc07cfc36) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/manual/embeddedwindows/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/manual/embeddedwindows/main.cpp b/tests/manual/embeddedwindows/main.cpp
index 98f40e358c..904839cfa3 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);
}