summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/sensors/sensors.cpp47
-rw-r--r--src/imports/sensors/sensors.pro8
2 files changed, 50 insertions, 5 deletions
diff --git a/src/imports/sensors/sensors.cpp b/src/imports/sensors/sensors.cpp
index 0d4394c7..c1bf21dc 100644
--- a/src/imports/sensors/sensors.cpp
+++ b/src/imports/sensors/sensors.cpp
@@ -68,6 +68,27 @@ public:
int major;
int minor;
+ // Register the 1.1 interfaces
+ major = 1;
+ minor = 1;
+ qmlRegisterUncreatableType<QSensorReading >(package, major, minor, "SensorReading", QLatin1String("Cannot create SensorReading"));
+ qmlRegisterType <QAccelerometer >(package, major, minor, "Accelerometer");
+ qmlRegisterType <QAccelerometerReading>(package, major, minor, "AccelerometerReading");
+ qmlRegisterType <QAmbientLightSensor >(package, major, minor, "AmbientLightSensor");
+ qmlRegisterType <QAmbientLightReading >(package, major, minor, "AmbientLightReading");
+ qmlRegisterType <QCompass >(package, major, minor, "Compass");
+ qmlRegisterType <QCompassReading >(package, major, minor, "CompassReading");
+ qmlRegisterType <QMagnetometer >(package, major, minor, "Magnetometer");
+ qmlRegisterType <QMagnetometerReading >(package, major, minor, "MagnetometerReading");
+ qmlRegisterType <QOrientationSensor >(package, major, minor, "OrientationSensor");
+ qmlRegisterType <QOrientationReading >(package, major, minor, "OrientationReading");
+ qmlRegisterType <QProximitySensor >(package, major, minor, "ProximitySensor");
+ qmlRegisterType <QProximityReading >(package, major, minor, "ProximityReading");
+ qmlRegisterType <QRotationSensor >(package, major, minor, "RotationSensor");
+ qmlRegisterType <QRotationReading >(package, major, minor, "RotationReading");
+ qmlRegisterType <QTapSensor >(package, major, minor, "TapSensor");
+ qmlRegisterType <QTapReading >(package, major, minor, "TapReading");
+
// Register the 1.2 interfaces
major = 1;
minor = 2;
@@ -93,6 +114,32 @@ public:
qmlRegisterUncreatableType<QLightReading >(package, major, minor, "LightReading", QLatin1String("Cannot create LightReading"));
qmlRegisterType <QGyroscope >(package, major, minor, "Gyroscope");
qmlRegisterUncreatableType<QGyroscopeReading >(package, major, minor, "GyroscopeReading", QLatin1String("Cannot create GyroscopeReading"));
+
+ // Register the 1.3 interfaces
+ major = 1;
+ minor = 3;
+ qmlRegisterUncreatableType<QSensor >(package, major, minor, "Sensor", QLatin1String("Cannot create Sensor"));
+ qmlRegisterUncreatableType<QSensorReading >(package, major, minor, "SensorReading", QLatin1String("Cannot create SensorReading"));
+ qmlRegisterType <QAccelerometer >(package, major, minor, "Accelerometer");
+ qmlRegisterUncreatableType<QAccelerometerReading>(package, major, minor, "AccelerometerReading", QLatin1String("Cannot create AccelerometerReading"));
+ qmlRegisterType <QAmbientLightSensor >(package, major, minor, "AmbientLightSensor");
+ qmlRegisterUncreatableType<QAmbientLightReading >(package, major, minor, "AmbientLightReading", QLatin1String("Cannot create AmbientLightReading"));
+ qmlRegisterType <QCompass >(package, major, minor, "Compass");
+ qmlRegisterUncreatableType<QCompassReading >(package, major, minor, "CompassReading", QLatin1String("Cannot create CompassReading"));
+ qmlRegisterType <QMagnetometer >(package, major, minor, "Magnetometer");
+ qmlRegisterUncreatableType<QMagnetometerReading >(package, major, minor, "MagnetometerReading", QLatin1String("Cannot create MagnetometerReading"));
+ qmlRegisterType <QOrientationSensor >(package, major, minor, "OrientationSensor");
+ qmlRegisterUncreatableType<QOrientationReading >(package, major, minor, "OrientationReading", QLatin1String("Cannot create OrientationReading"));
+ qmlRegisterType <QProximitySensor >(package, major, minor, "ProximitySensor");
+ qmlRegisterUncreatableType<QProximityReading >(package, major, minor, "ProximityReading", QLatin1String("Cannot create ProximityReading"));
+ qmlRegisterType <QRotationSensor >(package, major, minor, "RotationSensor");
+ qmlRegisterUncreatableType<QRotationReading >(package, major, minor, "RotationReading", QLatin1String("Cannot create RotationReading"));
+ qmlRegisterType <QTapSensor >(package, major, minor, "TapSensor");
+ qmlRegisterUncreatableType<QTapReading >(package, major, minor, "TapReading", QLatin1String("Cannot create TapReading"));
+ qmlRegisterType <QLightSensor >(package, major, minor, "LightSensor");
+ qmlRegisterUncreatableType<QLightReading >(package, major, minor, "LightReading", QLatin1String("Cannot create LightReading"));
+ qmlRegisterType <QGyroscope >(package, major, minor, "Gyroscope");
+ qmlRegisterUncreatableType<QGyroscopeReading >(package, major, minor, "GyroscopeReading", QLatin1String("Cannot create GyroscopeReading"));
qmlRegisterType <QIRProximitySensor >(package, major, minor, "IRProximitySensor");
qmlRegisterUncreatableType<QIRProximityReading >(package, major, minor, "IRProximityReading", QLatin1String("Cannot create IRProximityReading"));
}
diff --git a/src/imports/sensors/sensors.pro b/src/imports/sensors/sensors.pro
index 8223139f..d40565f4 100644
--- a/src/imports/sensors/sensors.pro
+++ b/src/imports/sensors/sensors.pro
@@ -1,8 +1,5 @@
TARGET = declarative_sensors
-TARGETPATH = Qt/sensors
-
-# Compatibility demands old path too.
-#TARGETPATH = QtMobility/sensors
+TARGETPATH = QtMobility/sensors
include(qsensorsimport.pri)
@@ -29,4 +26,5 @@ symbian {
importFiles.sources = $$DESTDIR/declarative_sensors$${QT_LIBINFIX}.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
DEPLOYMENT = importFiles
- }
+}
+