Qt Sensors QML Types

QML Sensors Module API

QmlSensors is a module API that provides information about currently available sensors types, identifiers, and the default sensors.

import QtSensors
//  ...
    Component.onCompleted: {
        var types = QmlSensors.sensorTypes();
        console.log(types.join(", "));
    }

The documentation for the module API can be found in QmlSensors.

QML Sensor Types

These types represent specific types of sensors.

Note that most properties come from the abstract Sensor element.

Accelerometer

Element reports on linear acceleration along the X, Y and Z axes

AmbientLightSensor

Element repors on ambient lighting conditions

AmbientTemperatureSensor

Element reports on the ambient temperature

Compass

Element reports on heading using magnetic north as a reference

Gyroscope

Element reports on rotational acceleration around the X, Y and Z axes

HumiditySensor

Element reports on humidity

LightSensor

Element reports on light levels using LUX

Magnetometer

Element reports on magnetic field strength along the Z, Y and Z axes

OrientationSensor

Element reports device orientation

PressureSensor

Element reports on atmospheric pressure values

ProximitySensor

Element reports on object proximity

RotationSensor

Element reports on device rotation around the X, Y and Z axes

TiltSensor

Element reports tilt events along the X and Y axes

QML Reading Types

The data from a sensor comes via a reading class.

AccelerometerReading

Element holds the most recent Accelerometer reading

AmbientLightReading

Element holds the most AmbientLightSensor reading

AmbientTemperatureReading

Element holds the most recent temperature reading

CompassReading

Element holds the most recent Compass reading

GyroscopeReading

Element holds the most recent Gyroscope reading

HumidityReading

Element holds the most recent HumiditySensor reading

LightReading

Element holds the most recent LightSensor reading

MagnetometerReading

Element holds the most recent Magnetometer reading

OrientationReading

Element holds the most recent OrientationSensor reading

PressureReading

Element holds the most recent PressureSensor reading

ProximityReading

Element holds the most recent ProximitySensor reading

RotationReading

Element holds the most recent RotationSensor reading

TiltReading

Element holds the most recent TiltSensor reading

All QML Types

Accelerometer

Element reports on linear acceleration along the X, Y and Z axes

AccelerometerReading

Element holds the most recent Accelerometer reading

AmbientLightReading

Element holds the most AmbientLightSensor reading

AmbientLightSensor

Element repors on ambient lighting conditions

AmbientTemperatureReading

Element holds the most recent temperature reading

AmbientTemperatureSensor

Element reports on the ambient temperature

Compass

Element reports on heading using magnetic north as a reference

CompassReading

Element holds the most recent Compass reading

Gyroscope

Element reports on rotational acceleration around the X, Y and Z axes

GyroscopeReading

Element holds the most recent Gyroscope reading

HumidityReading

Element holds the most recent HumiditySensor reading

HumiditySensor

Element reports on humidity

LightReading

Element holds the most recent LightSensor reading

LightSensor

Element reports on light levels using LUX

Magnetometer

Element reports on magnetic field strength along the Z, Y and Z axes

MagnetometerReading

Element holds the most recent Magnetometer reading

OrientationReading

Element holds the most recent OrientationSensor reading

OrientationSensor

Element reports device orientation

PressureReading

Element holds the most recent PressureSensor reading

PressureSensor

Element reports on atmospheric pressure values

ProximityReading

Element holds the most recent ProximitySensor reading

ProximitySensor

Element reports on object proximity

QmlSensors

Singleton provides the module API

RotationReading

Element holds the most recent RotationSensor reading

RotationSensor

Element reports on device rotation around the X, Y and Z axes

Sensor

Element serves as a base type for sensors

SensorReading

Element serves as a base type for sensor readings

TiltReading

Element holds the most recent TiltSensor reading

TiltSensor

Element reports tilt events along the X and Y axes

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