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>
This commit is contained in:
Tor Arne Vestbø 2023-08-15 21:49:03 +02:00 committed by Qt Cherry-pick Bot
parent 7e1321080c
commit 281ee04a82

View File

@ -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);
}