From da2e47edb0829df86c1bebc8969527eb71973293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 15 Aug 2023 21:48:05 +0200 Subject: [PATCH] embeddedwindows: Fill bounds, instead of event rect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Change-Id: I66cedb160fb0ed06935c06ba2fe5dec9ed468833 Reviewed-by: Tor Arne Vestbø Reviewed-by: Liang Qi (cherry picked from commit 61c043333b255afcd83260b78027242fc27a2e83) Reviewed-by: Qt Cherry-pick Bot --- tests/manual/embeddedwindows/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/manual/embeddedwindows/main.cpp b/tests/manual/embeddedwindows/main.cpp index db91d90387a..98f40e358c6 100644 --- a/tests/manual/embeddedwindows/main.cpp +++ b/tests/manual/embeddedwindows/main.cpp @@ -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: