QMagnetometer Class

The QMagnetometer class is a convenience wrapper around QSensor . 更多...

头: #include <QMagnetometer>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
继承: QSensor

特性

公共函数

QMagnetometer (QObject * parent = nullptr)
virtual ~QMagnetometer ()
QMagnetometerReading * reading () const
bool returnGeoValues () const
void setReturnGeoValues (bool returnGeoValues )

信号

void returnGeoValuesChanged (bool returnGeoValues )

详细描述

唯一行为差异是此类正确设置类型。

此类还特征 reading () 函数返回 QMagnetometerReading 而不是 QSensorReading .

有关传感器如何工作的细节,见 QMagnetometerReading .

另请参阅 QMagnetometerReading .

特性文档编制

returnGeoValues : bool

This property holds a value indicating if geomagnetic values should be returned.

Set to true to return geomagnetic flux density. Set to false (the default) to return raw magnetic flux density.

The property must be set before calling start ().

访问函数:

bool returnGeoValues () const
void setReturnGeoValues (bool returnGeoValues )

通知程序信号:

void returnGeoValuesChanged (bool returnGeoValues )

成员函数文档编制

[explicit] QMagnetometer:: QMagnetometer ( QObject * parent = nullptr)

构造传感器作为子级对于 parent .

[虚拟] QMagnetometer:: ~QMagnetometer ()

销毁传感器。停止传感器若尚未停止。

QMagnetometerReading *QMagnetometer:: reading () const

返回用于此传感器的读取类。

另请参阅 QSensor::reading ().