embeddedwindows: Fill bounds, instead of event rect

The event might come from a partial expose, but we want to
fill the entire bounds of the window, as we're filling with
a gradient.

Pick-to: 6.6
Change-Id: I66cedb160fb0ed06935c06ba2fe5dec9ed468833
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-08-15 21:48:05 +02:00
parent 4e2e3a6b4f
commit 61c043333b

View File

@ -29,11 +29,12 @@ protected:
update();
}
void paintEvent(QPaintEvent *event) override
void paintEvent(QPaintEvent *) override
{
QPainter painter(this);
painter.setCompositionMode(QPainter::CompositionMode_Source);
painter.fillRect(event->rect(), m_pressed ? QGradient(QGradient::JuicyPeach) : m_brush);
painter.fillRect(QRect(0, 0, width(), height()),
m_pressed ? QGradient(QGradient::JuicyPeach) : m_brush);
}
private: