summaryrefslogtreecommitdiff
path: root/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2012-03-22 14:18:58 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-22 05:54:12 +0100
commit06eaf5882495f2fad5d180e9b994e958c44eef28 (patch)
treed51312a87a3560d519f649653855345370a8f818 /src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp
parentda2aa2ea58460ef18c21cb03ba35bea57ccaebce (diff)
downloadqtsensors-06eaf5882495f2fad5d180e9b994e958c44eef28.tar.gz
use const where possible.
Change-Id: I2b78232c2ab25ebb7a931abcde18a9f01ff9c887 Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp')
-rw-r--r--src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp b/src/plugins/sensorgestures/qtsensors/qtwistsensorgesturerecognizer.cpp
index 80eb378..3956f17 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;