summaryrefslogtreecommitdiffstats
path: root/examples/widgets/touch/pinchzoom/mouse.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-09-06 23:24:56 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-10-11 06:32:30 +0200
commit4af00753fad57989a6ae366cc3dbfc56d88508f4 (patch)
tree1afa2fef01d285f85c13b814cbfaa95376b442ea /examples/widgets/touch/pinchzoom/mouse.cpp
parent65fcd8524da628c99e8cd28f983f0c17fbe157f0 (diff)
Cleanup QtWidgets examples
Cleanup QtWidgets examples: - use nullptr (clang-tidy) - use member-initialization - adjust the style - fix includes Change-Id: Ic5448606aacc525ea60b615a69227017aa2b821a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/widgets/touch/pinchzoom/mouse.cpp')
-rw-r--r--examples/widgets/touch/pinchzoom/mouse.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/widgets/touch/pinchzoom/mouse.cpp b/examples/widgets/touch/pinchzoom/mouse.cpp
index 1dfd7d749c..8456a0214d 100644
--- a/examples/widgets/touch/pinchzoom/mouse.cpp
+++ b/examples/widgets/touch/pinchzoom/mouse.cpp
@@ -56,8 +56,8 @@
#include <QStyleOption>
#include <qmath.h>
-const qreal Pi = M_PI;
-const qreal TwoPi = 2 * M_PI;
+constexpr qreal Pi = M_PI;
+constexpr qreal TwoPi = 2 * M_PI;
static qreal normalizeAngle(qreal angle)
{
@@ -69,9 +69,9 @@ static qreal normalizeAngle(qreal angle)
}
//! [0]
-Mouse::Mouse()
- : angle(0), speed(0), mouseEyeDirection(0),
- color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256))
+Mouse::Mouse() : color(QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256))
{
setTransform(QTransform().rotate(QRandomGenerator::global()->bounded(360 * 16)), true);
startTimer(1000 / 33);