diff options
Diffstat (limited to 'src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp')
-rw-r--r-- | src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp b/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp index 80eb3783..3956f17d 100644 --- a/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp +++ b/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp @@ -129,15 +129,15 @@ void QTwistSensorGestureRecognizer::orientationReadingChanged(QOrientationReadin void QTwistSensorGestureRecognizer::accelChanged(QAccelerometerReading *reading) { - qreal x = reading->x(); - qreal y = reading->y(); - qreal z = reading->z(); + const qreal x = reading->x(); + const qreal y = reading->y(); + const qreal z = reading->z(); - qreal diffX = lastX - x; - qreal diffY = lastY - y; + const qreal diffX = lastX - x; + const qreal diffY = lastY - y; pitch = qAtan(y / qSqrt(x*x + z*z)) * RADIANS_TO_DEGREES; - qreal degrees = qAtan(x / qSqrt(y*y + z*z)) * RADIANS_TO_DEGREES; + const qreal degrees = qAtan(x / qSqrt(y*y + z*z)) * RADIANS_TO_DEGREES; if (orientationReading == 0) return; |