summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/android/src/androidcompass.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-02-22 20:35:39 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2017-03-06 14:43:34 +0000
commit9a1b163e1fdd99a838c082805c687205b766da25 (patch)
treec9ce4b7fc05d93280628043c98c4e24b5c34e901 /src/plugins/sensors/android/src/androidcompass.cpp
parentbd1e063980355c82bb20af81a826a2860248ce6a (diff)
Use qRadiansToDegrees() and qDegreesToRadians() more widely
They document intent more clearly than arithmetic with pi does. Also eliminate some hand-rolled RADIANS_TO_DEGREES constants in favor of calling qRadiansToDegrees(). Change-Id: I7ca5e876b3591433bf681b56ad51c4cb409ac59f Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/sensors/android/src/androidcompass.cpp')
-rw-r--r--src/plugins/sensors/android/src/androidcompass.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/sensors/android/src/androidcompass.cpp b/src/plugins/sensors/android/src/androidcompass.cpp
index e98f0484..610dcde7 100644
--- a/src/plugins/sensors/android/src/androidcompass.cpp
+++ b/src/plugins/sensors/android/src/androidcompass.cpp
@@ -168,7 +168,6 @@ void AndroidCompass::testStuff()
return;
qreal azimuth = AndroidSensors::getCompassAzimuth(m_accelerometerListener->reading, m_magnetometerListener->reading);
- azimuth = azimuth * 180.0 / M_PI;
- m_reading.setAzimuth(azimuth);
+ m_reading.setAzimuth(qRadiansToDegrees(azimuth));
newReadingAvailable();
}