Inherited by: QTiltFilter, QTapFilter, QRotationFilter, QProximityFilter, QPressureFilter, QOrientationFilter, QMagnetometerFilter, QLightFilter, QLidFilter, QIRProximityFilter, QHumidityFilter, QGyroscopeFilter, QCompassFilter, QAmbientTemperatureFilter, QAmbientLightFilter, QAccelerometerFilter
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Some sensors (eg. the accelerometer) are often accessed very frequently. This may be slowed down by the use of signals and slots. The
QSensorFilter interface provides a more efficient way for the sensor to notify your class that the sensor has changed.
Additionally, multiple filters can be added to a sensor. They are called in order and each filter has the option to modify the values in the reading or to suppress the reading altogether.
Note that the values in the class returned by
reading() will not be updated until after the filters have been run.
- class PySide6.QtSensors.QSensorFilter#
- abstract PySide6.QtSensors.QSensorFilter.filter(reading)#
- Return type:
This function is called when the sensor
The filter can modify the reading.
Returns true to allow the next filter to receive the value. If this is the last filter, returning true causes the signal to be emitted and the value is stored in the sensor.
Returns false to drop the reading.