The QMagnetometerReading class represents one reading from the magnetometer. More...
#include <QMagnetometerReading>
Inherits: QSensorReading.
This class was introduced in Qt Mobility 1.0.
qreal | calibrationLevel () const |
void | setCalibrationLevel ( qreal calibrationLevel ) |
void | setX ( qreal x ) |
void | setY ( qreal y ) |
void | setZ ( qreal z ) |
qreal | x () const |
qreal | y () const |
qreal | z () const |
The QMagnetometerReading class represents one reading from the magnetometer.
The magnetometer returns magnetic flux density values along 3 axes. The scale of the values is teslas. The axes are arranged as follows.
The magnetometer can report on either raw magnetic flux values or geomagnetic flux values. By default it returns raw magnetic flux values. The QMagnetometer::returnGeoValues property must be set to return geomagnetic flux values.
The primary difference between raw and geomagnetic values is that extra processing is done to eliminate local magnetic interference from the geomagnetic values so they represent only the effect of the Earth's magnetic field. This process is not perfect and the accuracy of each reading may change.
The image below shows the difference between geomagnetic (on the left) and raw (on the right) readings for a phone that is being subjected to magnetic interference.
The accuracy of each reading is measured as a number from 0 to 1. A value of 1 is the highest level that the device can support and 0 is the worst.
See also CS001671 - Calibrating the magnetometer sensor.
This property holds the accuracy of the reading.
Measured as a value from 0 to 1 with higher values being better.
Note that this only changes when measuring geomagnetic flux density. Raw magnetic flux readings will always have a value of 1.
This property was introduced in Qt Mobility 1.0.
Access functions:
qreal | calibrationLevel () const |
See also QMagnetometerReading Units and CS001671 - Calibrating the magnetometer sensor.
This property holds the raw magnetic flux density on the X axis.
Measured as telsas.
This property was introduced in Qt Mobility 1.0.
Access functions:
qreal | x () const |
See also QMagnetometerReading Units.
This property holds the raw magnetic flux density on the Y axis.
Measured as telsas.
This property was introduced in Qt Mobility 1.0.
Access functions:
qreal | y () const |
See also QMagnetometerReading Units.
This property holds the raw magnetic flux density on the Z axis.
Measured as telsas.
This property was introduced in Qt Mobility 1.0.
Access functions:
qreal | z () const |
See also QMagnetometerReading Units.
Sets the accuracy of the reading to calibrationLevel.
This function was introduced in Qt Mobility 1.0.
See also calibrationLevel().
Sets the raw magnetic flux density on the X axis to x.
This function was introduced in Qt Mobility 1.0.
See also x().
Sets the raw magnetic flux density on the Y axis to y.
This function was introduced in Qt Mobility 1.0.
See also y().
Sets the raw magnetic flux density on the Z axis to z.
This function was introduced in Qt Mobility 1.0.
See also z().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.