QRotationSensor 类
QRotationSensor 类是对 QSensor 的一种便利包装。 更多信息...
| 头文件 | #include <QRotationSensor> | 
| CMake | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) | 
| qmake | QT += sensors | 
| 继承 | QSensor | 
属性Direct link to this headline
- hasZ : const bool
公共函数Direct link to this headline
| QRotationSensor(QObject *parent = nullptr) | |
| virtual | ~QRotationSensor() | 
| bool | hasZ() const | 
| QRotationReading * | reading() const | 
| void | setHasZ(bool hasZ) | 
信号Direct link to this headline
| void | hasZChanged(bool hasZ) | 
详细说明Direct link to this headline
此类的行为差异仅在于它正确地设置了类型。
此类还提供一个 reading() 函数,返回一个 QRotationReading 而不是 QSensorReading。
关于传感器工作详情,请参阅 QRotationReading。
另请参阅QRotationReading。
属性文档
[read-only] hasZ : const boolDirect link to this headline
此属性包含一个值,指示 z 角度是否可用。
如果 z 可用,则返回 true。如果 z 不可用,则返回 false。
访问函数
| bool | hasZ() const | 
通知信号
| void | hasZChanged(bool hasZ) | 
成员函数文档
[explicit] QRotationSensor::QRotationSensor(QObject *parent = nullptr)Direct link to this headline
以 parent 为父对象构造传感器。
[virtual noexcept] QRotationSensor::~QRotationSensor()Direct link to this headline
销毁传感器。如果传感器尚未停止,则停止传感器。
QRotationReading *QRotationSensor::reading() constDirect link to this headline
返回此传感器的读取类。
另请参阅 QSensor::reading。
void QRotationSensor::setHasZ(bool hasZ)
设置z角度是否可用给hasZ。这应在后端调用。默认情况下,hasZ属性为true,因此后端只有在其陀螺仪无法报告z角度时才需要调用此方法。
另请参阅 hasZ。
© 2024 The Qt Company Ltd。文档贡献版权归其各自的拥有者所有。此处提供的文档是根据由自由软件基金会发布的GNU自由文档许可证第1.3版的条款许可的。Qt及其相关标志是芬兰及/或世界其他国家的The Qt Company Ltd的商标。所有其他商标均为其各自所有者的财产。