Qt Sensors QML Types

QML Module API

If the module is imported into a namespace, some additional methods become available.

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

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

QML Sensor types

These types represent specific types of sensors.

Note that most properties come from the abstract Sensor element.

Accelerometer

The Accelerometer element reports on linear acceleration along the X, Y and Z axes.

AmbientLightSensor

The AmbientLightSensor element repors on ambient lighting conditions.

Compass

The Compass element reports on heading using magnetic north as a reference.

Gyroscope

The Gyroscope element reports on rotational acceleration around the X, Y and Z axes.

IRProximitySensor

The IRProximitySensor element reports on infra-red reflectance values.

LightSensor

The LightSensor element reports on light levels using LUX.

Magnetometer

The Magnetometer element reports on magnetic field strength along the Z, Y and Z axes.

OrientationSensor

The OrientationSensor element reports device orientation.

ProximitySensor

The ProximitySensor element reports on object proximity.

RotationSensor

The RotationSensor element reports on device rotation around the X, Y and Z axes.

TapSensor

The TapSensor element reports tap and double tap events along the X, Y and Z axes.

TiltSensor

The TiltSensor element reports tilt events along the X and Y axes.

QML Reading types

The data from a sensor comes through a reading class.

AccelerometerReading

The AccelerometerReading element holds the most recent Accelerometer reading.

AmbientLightReading

The AmbientLightReading element holds the most AmbientLightSensor reading.

CompassReading

The CompassReading element holds the most recent Compass reading.

GyroscopeReading

The GyroscopeReading element holds the most recent Gyroscope reading.

IRProximityReading

The IRProximityReading element holds the most recent IR proximity reading.

LightReading

The LightReading element holds the most recent LightSensor reading.

MagnetometerReading

The MagnetometerReading element holds the most recent Magnetometer reading.

OrientationReading

The OrientationReading element holds the most recent OrientationSensor reading.

ProximityReading

The ProximityReading element holds the most recent ProximitySensor reading.

RotationReading

The RotationReading element holds the most recent RotationSensor reading.

TapReading

The TapReading element holds the most recent TapSensor reading.

TiltReading

The TiltReading element holds the most recent TiltSensor reading.

Accelerometer

The Accelerometer element reports on linear acceleration along the X, Y and Z axes.

AccelerometerReading

The AccelerometerReading element holds the most recent Accelerometer reading.

AmbientLightReading

The AmbientLightReading element holds the most AmbientLightSensor reading.

AmbientLightSensor

The AmbientLightSensor element repors on ambient lighting conditions.

Compass

The Compass element reports on heading using magnetic north as a reference.

CompassReading

The CompassReading element holds the most recent Compass reading.

Gyroscope

The Gyroscope element reports on rotational acceleration around the X, Y and Z axes.

GyroscopeReading

The GyroscopeReading element holds the most recent Gyroscope reading.

IRProximityReading

The IRProximityReading element holds the most recent IR proximity reading.

IRProximitySensor

The IRProximitySensor element reports on infra-red reflectance values.

LightReading

The LightReading element holds the most recent LightSensor reading.

LightSensor

The LightSensor element reports on light levels using LUX.

Magnetometer

The Magnetometer element reports on magnetic field strength along the Z, Y and Z axes.

MagnetometerReading

The MagnetometerReading element holds the most recent Magnetometer reading.

OrientationReading

The OrientationReading element holds the most recent OrientationSensor reading.

OrientationSensor

The OrientationSensor element reports device orientation.

ProximityReading

The ProximityReading element holds the most recent ProximitySensor reading.

ProximitySensor

The ProximitySensor element reports on object proximity.

RotationReading

The RotationReading element holds the most recent RotationSensor reading.

RotationSensor

The RotationSensor element reports on device rotation around the X, Y and Z axes.

Sensor

The Sensor element serves as a base type for sensors.

SensorGesture

Provides notifications when sensor-based gestures are detected.

SensorGlobal

The SensorGlobal element provides the module API.

SensorReading

The SensorReading element serves as a base type for sensor readings.

TapReading

The TapReading element holds the most recent TapSensor reading.

TapSensor

The TapSensor element reports tap and double tap events along the X, Y and Z axes.

TiltReading

The TiltReading element holds the most recent TiltSensor reading.

TiltSensor

The TiltSensor element reports tilt events along the X and Y axes.