summaryrefslogtreecommitdiffstats
path: root/examples/gui/doc
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-03-20 16:40:08 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-03-20 16:00:31 +0000
commit9c17b8adb940fc32b29fe8d012d76b5c1b78a90f (patch)
treed4da631e22ae2b39a614bd4143ed5e2e1157a0b5 /examples/gui/doc
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 <simon.hausmann@qt.io>
Diffstat (limited to 'examples/gui/doc')
-rw-r--r--examples/gui/doc/src/rasterwindow.qdoc5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/gui/doc/src/rasterwindow.qdoc b/examples/gui/doc/src/rasterwindow.qdoc
index 36612e1707..0c52a62b8e 100644
--- a/examples/gui/doc/src/rasterwindow.qdoc
+++ b/examples/gui/doc/src/rasterwindow.qdoc
@@ -99,9 +99,8 @@
The resize event is guaranteed to be called prior to the window
being shown on screen and will also be called whenever the window
- is resized while on screen. We use this to resize the back buffer
- and call renderNow() if we are visible to immediately update the
- visual representation of the window on screen.
+ is resized while on screen. We use this to resize the back buffer,
+ and defer rendering to the corresponding/following expose event.
\snippet rasterwindow/rasterwindow.cpp 3