QCompassReading Class
The QCompassReading class represents one reading from a compass. 更多...
头文件: | #include <QCompassReading> |
qmake: | QT += sensors |
开始支持版本: | Qt 5.1 |
基类: | QSensorReading |
属性
- azimuth : const qreal
- calibrationLevel : const qreal
- 1 个属性继承自 QSensorReading
- 1 个属性继承自 QObject
公有函数
qreal | azimuth() const |
qreal | calibrationLevel() const |
void | setAzimuth(qreal azimuth) |
void | setCalibrationLevel(qreal calibrationLevel) |
- 4 个公有函数继承自 QSensorReading
- 32 个公有函数继承自 QObject
其他继承的成员
- 1 个公有槽函数继承自 QObject
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
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 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
This property holds the azimuth of the device.
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 |
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.
访问函数:
qreal | calibrationLevel() const |
成员函数
void QCompassReading::setAzimuth(qreal azimuth)
Sets the azimuth of the device.
参见 azimuth() and QCompassReading Units.
void QCompassReading::setCalibrationLevel(qreal calibrationLevel)
Sets the calibration level of the reading to calibrationLevel.
参见 calibrationLevel().