summaryrefslogtreecommitdiffstats
path: root/examples/corelib/threads
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 16:16:29 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-11 16:23:19 +0200
commitf4b4c4f79b629498f3cddbbc10df8c1b4d6020d9 (patch)
tree4119707660438ff58bd51f9cbe0f9e2a33f4b806 /examples/corelib/threads
parent9bd6cec74dbbc5aece55dc0c8808494db29b9963 (diff)
parent93f2f33a49f6c96a4f94f344edf03164ed944d02 (diff)
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Diffstat (limited to 'examples/corelib/threads')
-rw-r--r--examples/corelib/threads/doc/src/mandelbrot.qdoc4
-rw-r--r--examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/corelib/threads/doc/src/mandelbrot.qdoc b/examples/corelib/threads/doc/src/mandelbrot.qdoc
index 274874632e..9e3fdc1dfe 100644
--- a/examples/corelib/threads/doc/src/mandelbrot.qdoc
+++ b/examples/corelib/threads/doc/src/mandelbrot.qdoc
@@ -304,8 +304,8 @@
\snippet threads/mandelbrot/mandelbrotwidget.cpp 12
The wheel event handler is reimplemented to make the mouse wheel
- control the zoom level. QWheelEvent::delta() returns the angle of
- the wheel mouse movement, in eights of a degree. For most mice,
+ control the zoom level. QWheelEvent::angleDelta() returns the angle
+ of the wheel mouse movement, in eighths of a degree. For most mice,
one wheel step corresponds to 15 degrees. We find out how many
mouse steps we have and determine the resulting zoom factor.
For example, if we have two wheel steps in the positive direction
diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
index 71d0abb09f..822791533b 100644
--- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
+++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
@@ -176,7 +176,7 @@ void MandelbrotWidget::keyPressEvent(QKeyEvent *event)
//! [12]
void MandelbrotWidget::wheelEvent(QWheelEvent *event)
{
- int numDegrees = event->delta() / 8;
+ int numDegrees = event->angleDelta().y() / 8;
double numSteps = numDegrees / 15.0f;
zoom(pow(ZoomInFactor, numSteps));
}