QCompassReading 类

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

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

特性

公共函数

QCompassReading (QObject * parent = DECLARE_READING(QCompassReading))
virtual ~QCompassReading ()
qreal azimuth () const
qreal calibrationLevel () const
void setAzimuth (qreal azimuth )
void setCalibrationLevel (qreal calibrationLevel )

重实现公共函数

virtual void copyValuesFrom (QSensorReading * other ) override

静态公共成员

const QMetaObject staticMetaObject

额外继承成员

详细描述

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 QScreen::nativeOrientation .

访问函数:

qreal azimuth () const

另请参阅 QCompassReading 单位 .

calibrationLevel : const qreal

此特性保持读取的校准级别。

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

访问函数:

qreal calibrationLevel () const

另请参阅 QCompassReading 单位 .

成员函数文档编制

QCompassReading:: QCompassReading ( QObject * parent = DECLARE_READING(QCompassReading))

Default constructs an instance of QCompassReading.

[虚拟] QCompassReading:: ~QCompassReading ()

Destroys the instance of QCompassReading. The destructor is virtual.

[override virtual] void QCompassReading:: copyValuesFrom ( QSensorReading * other )

void QCompassReading:: setAzimuth ( qreal azimuth )

设置 azimuth 为设备。

另请参阅 azimuth () 和 QCompassReading 单位 .

void QCompassReading:: setCalibrationLevel ( qreal calibrationLevel )

将读取的校准级别设为 calibrationLevel .

另请参阅 calibrationLevel ().