class QCompassReading#

The QCompassReading class represents one reading from a compass. More

Inheritance diagram of PySide6.QtSensors.QCompassReading

Synopsis#

Properties#

Methods#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property azimuthᅟ: float#

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

See also

QCompassReading Units

Access functions:
property calibrationLevelᅟ: float#

This property holds the calibration level of the reading..

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

See also

QCompassReading Units

Access functions:
__init__(parent)#
Parameters:

parentQObject

azimuth()#
Return type:

float

See also

setAzimuth()

Getter of property azimuthᅟ .

calibrationLevel()#
Return type:

float

Getter of property calibrationLevelᅟ .

setAzimuth(azimuth)#
Parameters:

azimuth – float

Sets the azimuth of the device.

See also

azimuth() QCompassReading Units

setCalibrationLevel(calibrationLevel)#
Parameters:

calibrationLevel – float

Sets the calibration level of the reading to calibrationLevel.