QPressureReading Class
QPressureReading 类存储来自压力传感器的读数。更多内容...
| 头文件: | #include <QPressureReading> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) |
| qmake: | QT += sensors |
| 继承自: | QSensorReading |
属性
- pressure : qreal
- temperature : qreal
公共函数
| qreal | pressure() const |
| void | setPressure(qreal pressure) |
| void | setTemperature(qreal temperature) |
| qreal | temperature() const |
属性文档
[read-only] pressure : qreal
该属性存储测得的大气压值。
返回单位为帕斯卡。
访问函数:
| qreal | pressure() const |
另请参阅 QPressureReading Units 。
[read-only] temperature : qreal
该属性存储压力传感器的温度。
温度以摄氏度为单位返回。如果系统支持此属性,则返回压力传感器芯片的温度。请注意,该温度可能(且通常)与QAmbientTemperatureSensor 报告的温度不同。请使用QSensor::isFeatureSupported()并配合QSensor::PressureSensorTemperature 标志来确定该属性的可用性。
访问函数:
| qreal | temperature() const |
成员函数文档
void QPressureReading::setPressure(qreal pressure)
将压力设置为pressure 。
另请参阅 pressure()。
void QPressureReading::setTemperature(qreal temperature)
将压力传感器的温度设置为temperature 。
另请参阅 temperature()。
© 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.