QtMobility Reference Documentation

Contents

Sensors QML Plugin

Overview

The identifying string for this component is "QtMobility.sensors". Use this in the QML import statement.

The Sensors QML Plugin registers the C++ Sensors classes directly to the QML environment. This causes some limitations due to the use of types that do not work in the QML environment. See below for a list of the known limitations.

See Sensors for more information about the Sensors API.

Sensors QML Limitations

The following limitations affect the Sensors QML bindings for Qt Mobility 1.1 and 1.2.

  1. The QSensor::sensorid property cannot be set because QML does not support QByteArray. This means that it is not possible to specify a particular sensor when two or more have been registered with the same type.
  2. The QSensor::availableDataRates property cannot be used because QML does not support qrangelist.
  3. The QSensor::outputRanges property cannot be used because QML does not support qoutputrangelist.
  4. The QLightSensor::fieldOfView property cannot be used because QML cannot access dynamic properties.
  5. The QMagnetometer::returnGeoValues property cannot be used because QML cannot access dynamic properties.
  6. The QRotationSensor::hasZ property cannot be used because QML cannot access dynamic properties.
  7. The QTapSensor::returnDoubleTapEvents property cannot be used because QML cannot access dynamic properties.

QML Sensor Elements

These elements represent specific types of sensors.

QML Accelerometer Element

The Accelerometer element wraps the QAccelerometer class.

QML AmbientLightSensor Element

The AmbientLightSensor element wraps the QAmbientLightSensor class.

QML Compass Element

The Compass element wraps the QCompass class.

QML Gyroscope Element

The Gyroscope element wraps the QGyroscope class.

QML LightSensor Element

The LightSensor element wraps the QLightSensor class.

QML Magnetometer Element

The Magnetometer element wraps the QMagnetometer class.

QML OrientationSensor Element

The OrientationSensor element wraps the QOrientationSensor class.

QML ProximitySensor Element

The ProximitySensor element wraps the QProximitySensor class.

QML RotationSensor Element

The RotationSensor element wraps the QRotationSensor class.

QML TapSensor Element

The TapSensor element wraps the QTapSensor class.

QML Reading Elements

The data from a sensor comes through a reading class.

QML AccelerometerReading Element

The AccelerometerReading element wraps the QAccelerometerReading class.

QML AmbientLightReading Element

The AmbientLightReading element wraps the QAmbientLightReading class.

QML CompassReading Element

The CompassReading element wraps the QCompassReading class.

QML GyroscopeReading Element

The GyroscopeReading element wraps the QGyroscopeReading class.

QML LightReading Element

The LightReading element wraps the QLightReading class.

QML MagnetometerReading Element

The MagnetometerReading element wraps the QMagnetometerReading class.

QML OrientationReading Element

The OrientationReading element wraps the QOrientationReading class.

QML ProximityReading Element

The ProximityReading element wraps the QProximityReading class.

QML RotationReading Element

The RotationReading element wraps the QRotationReading class.

QML TapReading Element

The TapReading element wraps the QTapReading class.