MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QCompassReading Class Reference

The QCompassReading class represents one reading from a compass. More...

 #include <QCompassReading>

Inherits: QSensorReading.

This class was introduced in Qt Mobility 1.0.

Properties

Public Functions

qreal azimuth () const
qreal calibrationLevel () const
void setAzimuth ( qreal azimuth )
void setCalibrationLevel ( qreal calibrationLevel )

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 1 public variable inherited from QObject
  • 4 static public members inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QCompassReading class represents one reading from a compass.

QCompassReading Units

The compass returns the azimuth of the device as degrees from magnetic north in a clockwise direction based on the top of the UI. There is also a value to indicate the calibration status of the device. If the device is not calibrated the azimuth may not be accurate.

Digital compasses are susceptible to magnetic interference and may need calibration after being placed near anything that emits a magnetic force. Accuracy of the compass can be affected by any ferrous materials that are nearby.

The calibration status of the device 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.

Property Documentation

azimuth : const qreal

This property holds the azimuth of the device.

Measured in degrees from magnetic north in a clockwise direction based the top of the UI.

This property was introduced in Qt Mobility 1.0.

Access functions:

qreal azimuth () const

See also QCompassReading Units.

calibrationLevel : const qreal

This property holds the calibration level of the reading.

Measured as a value from 0 to 1 with higher values being better.

This property was introduced in Qt Mobility 1.0.

Access functions:

qreal calibrationLevel () const

See also QCompassReading Units and CS001671 - Calibrating the magnetometer sensor.

Member Function Documentation

void QCompassReading::setAzimuth ( qreal azimuth )

Sets the azimuth of the device.

This function was introduced in Qt Mobility 1.0.

See also azimuth() and QCompassReading Units.

void QCompassReading::setCalibrationLevel ( qreal calibrationLevel )

Sets the calibration level of the reading to calibrationLevel.

This function was introduced in Qt Mobility 1.0.

See also calibrationLevel().