diff options
Diffstat (limited to 'examples/corelib/threads/doc/src/mandelbrot.qdoc')
-rw-r--r-- | examples/corelib/threads/doc/src/mandelbrot.qdoc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/examples/corelib/threads/doc/src/mandelbrot.qdoc b/examples/corelib/threads/doc/src/mandelbrot.qdoc index e0f703bf3c..6081912e69 100644 --- a/examples/corelib/threads/doc/src/mandelbrot.qdoc +++ b/examples/corelib/threads/doc/src/mandelbrot.qdoc @@ -3,7 +3,8 @@ /*! \example threads/mandelbrot - \title Mandelbrot Example + \examplecategory {Data Processing & I/O} + \title Mandelbrot \ingroup qtconcurrent-mtexamples \brief The Mandelbrot example demonstrates multi-thread programming @@ -13,17 +14,17 @@ \image mandelbrot-example.png Screenshot of the Mandelbrot example - The heavy computation here is the Mandelbrot set, probably the - world's most famous fractal. These days, while sophisticated - programs such as \l{http://matek.hu/xaos/doku.php}{XaoS} that provide real-time zooming in the - Mandelbrot set, the standard Mandelbrot algorithm is just slow - enough for our purposes. + The heavy computation here is the Mandelbrot set, probably the world's most + famous fractal. These days, while sophisticated programs, such as + \l{https://xaos-project.github.io/}{XaoS}, provide real-time zooming in + the Mandelbrot set, the standard Mandelbrot algorithm is just slow enough + for our purposes. In real life, the approach described here is applicable to a large set of problems, including synchronous network I/O and database access, where the user interface must remain responsive while some heavy operation is taking place. The \l - {Blocking Fortune Client Example} shows the same principle at + {Blocking Fortune Client} example shows the same principle at work in a TCP client. The Mandelbrot application supports zooming and scrolling using @@ -146,12 +147,12 @@ rendering parameters in local variables. As usual, we protect accesses to the member variables using the class's mutex. Storing the member variables in local variables allows us to minimize the - amout of code that needs to be protected by a mutex. This ensures + amount of code that needs to be protected by a mutex. This ensures that the main thread will never have to block for too long when it needs to access \c{RenderThread}'s member variables (e.g., in \c render()). - The \c forever keyword is, like \c foreach, a Qt pseudo-keyword. + The \c forever keyword is a Qt pseudo-keyword. \snippet threads/mandelbrot/renderthread.cpp 4 \snippet threads/mandelbrot/renderthread.cpp 5 @@ -303,6 +304,11 @@ \snippet threads/mandelbrot/mandelbrotwidget.cpp 13 + Pinch to zoom has been implemented with QGesture as outlined in + \l{Gestures in Widgets and Graphics View}. + + \snippet threads/mandelbrot/mandelbrotwidget.cpp gesture1 + When the user presses the left mouse button, we store the mouse pointer position in \c lastDragPos. |