diff options
Diffstat (limited to 'examples/widgets/graphicsview/collidingmice/mouse.cpp')
-rw-r--r-- | examples/widgets/graphicsview/collidingmice/mouse.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/widgets/graphicsview/collidingmice/mouse.cpp b/examples/widgets/graphicsview/collidingmice/mouse.cpp index a8fcc05d76..556e58d19b 100644 --- a/examples/widgets/graphicsview/collidingmice/mouse.cpp +++ b/examples/widgets/graphicsview/collidingmice/mouse.cpp @@ -54,10 +54,10 @@ #include <QPainter> #include <QRandomGenerator> #include <QStyleOption> -#include <qmath.h> +#include <QtMath> -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) { @@ -70,8 +70,7 @@ 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)) + : color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256)) { setRotation(QRandomGenerator::global()->bounded(360 * 16)); } |