path: root/examples/gui/rasterwindow
diff options
authorTor Arne Vestbø <>2018-03-20 16:40:08 +0100
committerTor Arne Vestbø <>2018-03-20 16:00:31 +0000
commit9c17b8adb940fc32b29fe8d012d76b5c1b78a90f (patch)
treed4da631e22ae2b39a614bd4143ed5e2e1157a0b5 /examples/gui/rasterwindow
parentea60b4eb9a257a9b9b5713f01d2e69f5eba3f94d (diff)
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 <>
Diffstat (limited to 'examples/gui/rasterwindow')
1 files changed, 0 insertions, 2 deletions
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)
- if (isExposed())
- renderNow();
//! [5]