QRotationSensor Class

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

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

特性

公共函数

QRotationSensor (QObject * parent = nullptr)
virtual ~QRotationSensor ()
bool hasZ () const
QRotationReading * reading () const
void setHasZ (bool hasZ )

信号

void hasZChanged (bool hasZ )

详细描述

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

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

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

另请参阅 QRotationReading .

特性文档编制

[read-only] hasZ : const bool

This property holds a value indicating if the z angle is available.

Returns true if z is available. Returns false if z is not available.

访问函数:

bool hasZ () const

通知程序信号:

void hasZChanged (bool hasZ )

成员函数文档编制

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

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

[virtual noexcept] QRotationSensor:: ~QRotationSensor ()

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

QRotationReading *QRotationSensor:: reading () const

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

另请参阅 QSensor::reading ().

void QRotationSensor:: setHasZ ( bool hasZ )

Sets whether the z angle is available to hasZ . This is to be called from the backend. By default the hasZ property is true, so a backend only has to call this if its rotation sensor can not report z angles.

另请参阅 hasZ ().