QLightSensor Class
QLightSensor 类是QSensor 的方便封装。更多
头文件: | #include <QLightSensor> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) |
qmake: | QT += sensors |
继承: | QSensor |
属性
- fieldOfView : const qreal
公共功能
QLightSensor(QObject *parent = nullptr) | |
virtual | ~QLightSensor() |
qreal | fieldOfView() const |
QLightReading * | reading() const |
void | setFieldOfView(qreal fieldOfView) |
信号
void | fieldOfViewChanged(qreal fieldOfView) |
详细说明
该类唯一的行为区别是正确设置了类型。
该类还有一个reading() 函数,返回QLightReading 而不是QSensorReading 。
有关传感器工作原理的详细信息,请参见QLightReading 。
另请参见 QLightReading 。
属性文档
[read-only]
fieldOfView : const qreal
该属性包含一个表示视场的值。
这是一个表示传感器视场的角度。
并非所有光线传感器都支持视场角检索。可以使用QSensor::isFeatureSupported() 和QSensor::FieldOfView 标志检查是否支持视场。
访问功能:
qreal | fieldOfView() const |
Notifier 信号:
void | fieldOfViewChanged(qreal fieldOfView) |
成员函数 文档
[explicit]
QLightSensor::QLightSensor(QObject *parent = nullptr)
将传感器构建为parent 的子节点。
[virtual noexcept]
QLightSensor::~QLightSensor()
销毁传感器。如果传感器尚未停止,则将其停止。
QLightReading *QLightSensor::reading() const
返回此传感器的读数类别。
另请参阅 QSensor::reading()。
void QLightSensor::setFieldOfView(qreal fieldOfView)
将视场设置为fieldOfView 。该命令由后台调用。
另请参阅 fieldOfView() 。
© 2025 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.