QCompassReading 類

The QCompassReading class represents one reading from a compass. 更多...

頭: #include <QCompassReading>
qmake: QT += sensors
Since: Qt 5.1
繼承: QSensorReading

特性

公共函數

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

額外繼承成員

詳細描述

The QCompassReading class represents one reading from a compass.

QCompassReading 單位

The compass returns the azimuth of the device as degrees from magnetic north in a clockwise direction based on the top of the device, as defined by QScreen::nativeOrientation . 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.

特性文檔編製

azimuth : const qreal

此特性保持設備的方位角。

Measured in degrees from magnetic north in a clockwise direction based on the top of the device, as defined by QPlatformScreen::nativeOrientation .

訪問函數:

qreal azimuth () const

另請參閱 QCompassReading 單位 .

calibrationLevel : const qreal

此特性保持讀取的校準級彆。

度量值從 0 到 1,更高值更佳。

訪問函數:

qreal calibrationLevel () const

另請參閱 QCompassReading 單位 .

成員函數文檔編製

void QCompassReading:: setAzimuth ( qreal azimuth )

設置 azimuth 為設備。

另請參閱 azimuth () 和 QCompassReading 單位 .

void QCompassReading:: setCalibrationLevel ( qreal calibrationLevel )

將讀取的校準級彆設為 calibrationLevel .

另請參閱 calibrationLevel ().