From 9c17b8adb940fc32b29fe8d012d76b5c1b78a90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 20 Mar 2018 16:40:08 +0100 Subject: Update rasterwindow example to not render in resizeEvent The resize event should not be used to draw, as there will be a follow-up exposeEvent delivered just after, and we don't want to draw twice. This is how QRasterWindow operates too, except it defers the backingstore resize to beginPaint() instead of resizing in the reizeEvent. It's also how QOpenGLWindow operates, which also has a note for the virtual resizeGL method saying: "Scheduling updates from here is not necessary. The windowing systems will send expose events that trigger an update automatically." Change-Id: I2a9740018508c2eb129149f53237ee8e378c03b1 Reviewed-by: Simon Hausmann --- examples/gui/rasterwindow/rasterwindow.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'examples/gui/rasterwindow/rasterwindow.cpp') diff --git a/examples/gui/rasterwindow/rasterwindow.cpp b/examples/gui/rasterwindow/rasterwindow.cpp index 3eacd20145..e240b7f31c 100644 --- a/examples/gui/rasterwindow/rasterwindow.cpp +++ b/examples/gui/rasterwindow/rasterwindow.cpp @@ -83,8 +83,6 @@ void RasterWindow::renderLater() void RasterWindow::resizeEvent(QResizeEvent *resizeEvent) { m_backingStore->resize(resizeEvent->size()); - if (isExposed()) - renderNow(); } //! [5] -- cgit v1.2.3