本页内容

QOrientationSensor Class

QOrientationSensor 类是围绕QSensor 构建的一个便捷封装类。更多内容...

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

公共函数

QOrientationSensor(QObject *parent = nullptr)
virtual ~QOrientationSensor()
QOrientationReading *reading() const

详细说明

唯一的行為差異在於,此類別會正確地設定類型。

该类还提供了一个reading()函数,该函数返回QOrientationReading ,而不是QSensorReading 。

有关传感器工作原理的详细信息,请参阅QOrientationReading 。

另请参阅 QOrientationReading 。

成员函数文档

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

将该传感器作为parent 的子节点进行构建。

[virtual noexcept] QOrientationSensor::~QOrientationSensor()

销毁传感器。如果传感器尚未停止运行,则将其停止。

QOrientationReading *QOrientationSensor::reading() const

返回该传感器的读取类。

另请参阅 QSensor::reading()。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.