summaryrefslogtreecommitdiffstats
path: root/examples/corelib/threads/doc/src/mandelbrot.qdoc
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2020-03-16 18:41:27 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-03-16 20:43:50 +0100
commitc2f167b41284cee3570434deba85f26f14ff241f (patch)
treeb0f52f86a8df266547d7ec7afa22d0c0d68d3532 /examples/corelib/threads/doc/src/mandelbrot.qdoc
parent9f9049b486a47aef0c7e2e3852b20aa4ffdce748 (diff)
parentff922e7b87de147797fbd759167878aec7625f0c (diff)
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Diffstat (limited to 'examples/corelib/threads/doc/src/mandelbrot.qdoc')
-rw-r--r--examples/corelib/threads/doc/src/mandelbrot.qdoc25
1 files changed, 19 insertions, 6 deletions
diff --git a/examples/corelib/threads/doc/src/mandelbrot.qdoc b/examples/corelib/threads/doc/src/mandelbrot.qdoc
index b32fa097b3..2b12743538 100644
--- a/examples/corelib/threads/doc/src/mandelbrot.qdoc
+++ b/examples/corelib/threads/doc/src/mandelbrot.qdoc
@@ -187,6 +187,10 @@
generate more and more precise (and computationally expensive)
approximations of the fractal.
+ We create a high resolution pixmap by applying the device
+ pixel ratio to the target size (see
+ \l{Drawing High Resolution Versions of Pixmaps and Images}).
+
If we discover inside the loop that \c restart has been set to \c
true (by \c render()), we break out of the loop immediately, so
that the control quickly returns to the very top of the outer
@@ -273,12 +277,21 @@
\snippet threads/mandelbrot/mandelbrotwidget.cpp 8
If the pixmap has the right scale factor, we draw the pixmap directly onto
- the widget. Otherwise, we scale and translate the \l{Coordinate
- System}{coordinate system} before we draw the pixmap. By reverse mapping
- the widget's rectangle using the scaled painter matrix, we also make sure
- that only the exposed areas of the pixmap are drawn. The calls to
- QPainter::save() and QPainter::restore() make sure that any painting
- performed afterwards uses the standard coordinate system.
+ the widget.
+
+ Otherwise, we create a preview pixmap to be shown until the calculation
+ finishes and translate the \l{Coordinate System}{coordinate system}
+ accordingly.
+
+ Since we are going to use transformations on the painter
+ and use an overload of QPainter::drawPixmap() that does not support
+ high resolution pixmaps in that case, we create a pixmap with device pixel
+ ratio 1.
+
+ By reverse mapping the widget's rectangle using the scaled painter matrix,
+ we also make sure that only the exposed areas of the pixmap are drawn.
+ The calls to QPainter::save() and QPainter::restore() make sure that any
+ painting performed afterwards uses the standard coordinate system.
\snippet threads/mandelbrot/mandelbrotwidget.cpp 9