QSensorFilter Class

QSensorFilter 클래스는 센서 변경에 대한 비동기 알림을 위한 효율적인 콜백 기능을 제공합니다. 더 보기...

Header: #include <QSensorFilter>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
상속 대상:
13 종류

QAccelerometerFilter, QAmbientLightFilter, QAmbientTemperatureFilter, QCompassFilter, QGyroscopeFilter, QHumidityFilter, QLightFilter, QMagnetometerFilter, QOrientationFilter, QPressureFilter, QProximityFilter, QRotationFilter, 그리고 QTiltFilter

공개 함수

virtual bool filter(QSensorReading *reading) = 0

보호된 함수

virtual ~QSensorFilter()

상세 설명

일부 센서(예: 가속도계)는 매우 자주 액세스하는 경우가 많습니다. 신호와 슬롯을 사용하면 속도가 느려질 수 있습니다. Q센서필터 인터페이스는 센서가 클래스에 센서가 변경되었음을 알리는 보다 효율적인 방법을 제공합니다.

또한 센서에 여러 필터를 추가할 수 있습니다. 필터는 순서대로 호출되며 각 필터에는 판독값을 수정하거나 판독값을 아예 표시하지 않을 수 있는 옵션이 있습니다.

QSensor::reading()에서 반환되는 클래스의 값은 필터가 실행될 때까지 업데이트되지 않는다는 점에 유의하세요.

filter()도 참조하세요 .

멤버 함수 문서

[virtual noexcept protected] QSensorFilter::~QSensorFilter()

연결된 센서(있는 경우)에 필터가 파기되고 있음을 알립니다.

[pure virtual] bool QSensorFilter::filter(QSensorReading *reading)

이 함수는 센서 reading 가 변경될 때 호출됩니다.

필터는 판독값을 수정할 수 있습니다.

참을 반환하면 다음 필터가 값을 수신할 수 있습니다. 마지막 필터인 경우 참을 반환하면 신호가 방출되고 값이 센서에 저장됩니다.

false를 반환하면 판독값을 삭제합니다.

© 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.