summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/examples/cubehouse.qdoc4
-rw-r--r--doc/src/examples/qmlqtsensors.qdoc6
-rw-r--r--doc/src/imports/qtsensors5.qdoc (renamed from doc/src/imports/qtmobilitysensors1.qdoc)15
-rw-r--r--doc/src/porting.qdoc8
-rw-r--r--doc/src/qtsensors.qdoc5
-rw-r--r--examples/sensors/accelbubble/accelbubble.qml2
-rw-r--r--examples/sensors/cubehouse/cubehouse.qml2
-rw-r--r--examples/sensors/grue/grue.qml2
-rw-r--r--examples/sensors/grue/import/main.cpp4
-rw-r--r--examples/sensors/maze/maze.qml2
-rw-r--r--examples/sensors/qmlqtsensors/qmlqtsensors.qml2
-rw-r--r--examples/sensors/qmlsensorgestures/GestureList.qml2
-rw-r--r--examples/sensors/qmlsensorgestures/GestureView.qml2
-rw-r--r--examples/sensors/qmlsensorgestures/GesturesView.qml2
-rw-r--r--examples/sensors/qmlsensorgestures/qmlsensorgestures.qml2
-rw-r--r--examples/sensors/shakeit/shakeit.qml2
-rw-r--r--src/imports/sensors/qmlaccelerometer.cpp18
-rw-r--r--src/imports/sensors/qmlambientlightsensor.cpp14
-rw-r--r--src/imports/sensors/qmlcompass.cpp16
-rw-r--r--src/imports/sensors/qmldir2
-rw-r--r--src/imports/sensors/qmlgyroscope.cpp18
-rw-r--r--src/imports/sensors/qmlirproximitysensor.cpp14
-rw-r--r--src/imports/sensors/qmllightsensor.cpp14
-rw-r--r--src/imports/sensors/qmlmagnetometer.cpp22
-rw-r--r--src/imports/sensors/qmlorientationsensor.cpp14
-rw-r--r--src/imports/sensors/qmlproximitysensor.cpp12
-rw-r--r--src/imports/sensors/qmlrotationsensor.cpp20
-rw-r--r--src/imports/sensors/qmlsensor.cpp38
-rw-r--r--src/imports/sensors/qmlsensorgesture.cpp20
-rw-r--r--src/imports/sensors/qmlsensorglobal.cpp14
-rw-r--r--src/imports/sensors/qmltapsensor.cpp18
-rw-r--r--src/imports/sensors/qmltiltsensor.cpp18
-rw-r--r--src/imports/sensors/sensors.cpp59
-rw-r--r--src/imports/sensors/sensors.pro4
-rw-r--r--src/sensors/gestures/qsensorgestureplugininterface.cpp2
-rw-r--r--tests/auto/legacy_sensors/tst_legacy_sensors.cpp157
-rw-r--r--tests/auto/legacy_sensors_qml/tst_qsensor.qml204
-rw-r--r--tests/auto/qsensor/tst_qsensor.cpp8
-rw-r--r--tests/auto/qtsensors5/tst_qtsensors5.cpp6
39 files changed, 433 insertions, 341 deletions
diff --git a/doc/src/examples/cubehouse.qdoc b/doc/src/examples/cubehouse.qdoc
index 31bad85c..37d5fe28 100644
--- a/doc/src/examples/cubehouse.qdoc
+++ b/doc/src/examples/cubehouse.qdoc
@@ -33,9 +33,9 @@
\image cubehouse.png
\section1 Overview
- To write a QML application that will use the QML Accelerometer type from the QtMobility.sensors import you need to to the following steps:
+ To write a QML application that will use the QML Accelerometer type from the QtSensors import you need to to the following steps:
- Import the QtMobility.sensors declarative plugin:
+ Import the QtSensors declarative plugin:
\snippet ../examples/sensors/cubehouse/cubehouse.qml 0
diff --git a/doc/src/examples/qmlqtsensors.qdoc b/doc/src/examples/qmlqtsensors.qdoc
index 4016fc44..ed6c99f4 100644
--- a/doc/src/examples/qmlqtsensors.qdoc
+++ b/doc/src/examples/qmlqtsensors.qdoc
@@ -54,16 +54,16 @@
Reading the data can be done for each sensor type like following:
- \l {QtMobility.sensors1::TiltSensor} {TiltSensor}
+ \l {QtSensors::TiltSensor} {TiltSensor}
\snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 3
\snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 4
- \l {QtMobility.sensors1::AmbientLightSensor} {AmbientLightSensor}
+ \l {QtSensors::AmbientLightSensor} {AmbientLightSensor}
\snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 5
- \l {QtMobility.sensors1::ProximitySensor} {ProximitySensor}
+ \l {QtSensors::ProximitySensor} {ProximitySensor}
\snippet ../examples/sensors/qmlqtsensors/qmlqtsensors.qml 6
*/
diff --git a/doc/src/imports/qtmobilitysensors1.qdoc b/doc/src/imports/qtsensors5.qdoc
index e040413c..02b53603 100644
--- a/doc/src/imports/qtmobilitysensors1.qdoc
+++ b/doc/src/imports/qtsensors5.qdoc
@@ -26,23 +26,20 @@
****************************************************************************/
/*!
- \qmlmodule QtMobility.sensors 1.3
- \title QtMobility.sensors 1.x
- \brief Legacy QML import for QtSensors
+ \qmlmodule QtSensors 5.0
+ \title Qt Sensors QML API
+ \brief QML import for QtSensors
\section1 Overview
- This is the legacy QML import. It exists for compatibility with the QtMobiltiy 1.2 release
- and is not recommended for new applications.
-
- See \l{Qt Sensors} for more information about the Sensors API.
+ This is the QtSensors QML import.
\section1 QML Module API
If the module is imported into a namespace, some additional methods become available.
\code
- import QtMobility.sensors 1.3 as Sensors
+ import QtSensors 5.0 as Sensors
...
Component.onCompleted: {
var types = Sensors.sensorTypes();
@@ -56,7 +53,7 @@
These types represent specific types of sensors.
- Note that most properties come from the abstract \l{QtMobility.sensors1::Sensor}{Sensor} element.
+ Note that most properties come from the abstract \l{QtSensors::Sensor}{Sensor} element.
\annotatedlist qml-sensors_type
diff --git a/doc/src/porting.qdoc b/doc/src/porting.qdoc
index 9a3ff716..24e0d7e6 100644
--- a/doc/src/porting.qdoc
+++ b/doc/src/porting.qdoc
@@ -39,8 +39,12 @@
\section1 QML
- QtSensors ships with a QML import that is mostly compatible with the QtMobility.sensors import.
- See \l {QtMobility.sensors 1.x} for more information.
+ QtSensors ships with a QML import that is compatible with the QtMobility.sensors import.
+ The limitations of the QtMobility.sensors import have been fixed and some new properties
+ may exist so apps may need to be updated if they are using custom properties on their
+ sensor objects.
+
+ See \l {Qt Sensors QML API} for more information.
\section1 C++
diff --git a/doc/src/qtsensors.qdoc b/doc/src/qtsensors.qdoc
index 0ab598e0..b437da28 100644
--- a/doc/src/qtsensors.qdoc
+++ b/doc/src/qtsensors.qdoc
@@ -39,7 +39,7 @@
\table
\row
- \li \l {QtMobility.sensors 1.x}{QML API}
+ \li \l {Qt Sensors QML API}{QML API}
\li Information about the Qt Sensors QML API
\row
\li \l {Qt Sensors C++ API}{C++ API}
@@ -69,9 +69,6 @@
\row
\li \l {Porting Applications from QtMobility Sensors to Qt Sensors}{Porting Guide}
\li Information about the steps needed to port applications to the Qt Sensors API.
- \row
- \li \l {QtMobility.sensors 1.x}{Legacy QML API}
- \li Information about the legacy QtMobility.sensors QML API
\endtable
diff --git a/examples/sensors/accelbubble/accelbubble.qml b/examples/sensors/accelbubble/accelbubble.qml
index 911c0383..726fb6ff 100644
--- a/examples/sensors/accelbubble/accelbubble.qml
+++ b/examples/sensors/accelbubble/accelbubble.qml
@@ -40,7 +40,7 @@
import QtQuick 2.0
//! [0]
-import QtMobility.sensors 1.2
+import QtSensors 5.0
//! [0]
diff --git a/examples/sensors/cubehouse/cubehouse.qml b/examples/sensors/cubehouse/cubehouse.qml
index b56ca5fd..ee2774a4 100644
--- a/examples/sensors/cubehouse/cubehouse.qml
+++ b/examples/sensors/cubehouse/cubehouse.qml
@@ -43,7 +43,7 @@ import Qt3D 1.0
import Qt3D.Shapes 1.0
//! [0]
-import QtMobility.sensors 1.3
+import QtSensors 5.0
//! [0]
import "."
diff --git a/examples/sensors/grue/grue.qml b/examples/sensors/grue/grue.qml
index 35449adc..65980165 100644
--- a/examples/sensors/grue/grue.qml
+++ b/examples/sensors/grue/grue.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtMobility.sensors 1.3
+import QtSensors 5.0
import Grue 1.0
Rectangle {
diff --git a/examples/sensors/grue/import/main.cpp b/examples/sensors/grue/import/main.cpp
index d892d892..db260bbd 100644
--- a/examples/sensors/grue/import/main.cpp
+++ b/examples/sensors/grue/import/main.cpp
@@ -111,7 +111,7 @@ QT_END_NAMESPACE
/*
\qmltype GrueSensor
\instantiates GrueSensor
- \inherits QtMobility.sensors1::Sensor
+ \inherits QtSensors::Sensor
\inqmlmodule Grue 1.0
\brief The GrueSensor type reports on your chance of being eaten by a Grue.
@@ -124,7 +124,7 @@ QT_END_NAMESPACE
/*
\qmltype GrueSensorReading
\instantiates GrueSensorReading
- \inherits QtMobility.sensors1::SensorReading
+ \inherits QtSensors::SensorReading
\inqmlmodule Grue 1.0
\brief The GrueSensorReading type holds the most recent GrueSensor reading.
diff --git a/examples/sensors/maze/maze.qml b/examples/sensors/maze/maze.qml
index 86103292..eeaea28f 100644
--- a/examples/sensors/maze/maze.qml
+++ b/examples/sensors/maze/maze.qml
@@ -73,7 +73,7 @@ import QtQuick 2.0
import "components"
//! [0]
-import QtMobility.sensors 1.3
+import QtSensors 5.0
//! [0]
import QtSystemInfo 5.0
diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.qml b/examples/sensors/qmlqtsensors/qmlqtsensors.qml
index 8f6f49b9..dfa9c4ec 100644
--- a/examples/sensors/qmlqtsensors/qmlqtsensors.qml
+++ b/examples/sensors/qmlqtsensors/qmlqtsensors.qml
@@ -88,7 +88,7 @@ import QtQuick 2.0
import "components"
//! [0]
-import QtMobility.sensors 1.3
+import QtSensors 5.0
//! [0]
ApplicationWindow {
diff --git a/examples/sensors/qmlsensorgestures/GestureList.qml b/examples/sensors/qmlsensorgestures/GestureList.qml
index 993fb430..ea79af3b 100644
--- a/examples/sensors/qmlsensorgestures/GestureList.qml
+++ b/examples/sensors/qmlsensorgestures/GestureList.qml
@@ -40,7 +40,7 @@
//Import the declarative plugins
import QtQuick 2.0
-import QtMobility.sensors 1.3
+import QtSensors 5.0
/* Layout
gesturerect
diff --git a/examples/sensors/qmlsensorgestures/GestureView.qml b/examples/sensors/qmlsensorgestures/GestureView.qml
index f1b0cb69..c12c6f28 100644
--- a/examples/sensors/qmlsensorgestures/GestureView.qml
+++ b/examples/sensors/qmlsensorgestures/GestureView.qml
@@ -42,7 +42,7 @@
import QtQuick 2.0
//! [0]
-import QtMobility.sensors 1.3
+import QtSensors 5.0
//! [0]
/* Layout
diff --git a/examples/sensors/qmlsensorgestures/GesturesView.qml b/examples/sensors/qmlsensorgestures/GesturesView.qml
index df91df67..ceab8d10 100644
--- a/examples/sensors/qmlsensorgestures/GesturesView.qml
+++ b/examples/sensors/qmlsensorgestures/GesturesView.qml
@@ -40,7 +40,7 @@
//Import the declarative plugins
import QtQuick 2.0
-import QtMobility.sensors 1.3
+import QtSensors 5.0
/* Layout
gesturerect
diff --git a/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml b/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml
index 2f76580a..af1f04a7 100644
--- a/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml
+++ b/examples/sensors/qmlsensorgestures/qmlsensorgestures.qml
@@ -40,7 +40,7 @@
//Import the declarative plugins
import QtQuick 2.0
-import QtMobility.sensors 1.3
+import QtSensors 5.0
/* Layout
--------------------------------------------------
diff --git a/examples/sensors/shakeit/shakeit.qml b/examples/sensors/shakeit/shakeit.qml
index d1a142b8..00eeb262 100644
--- a/examples/sensors/shakeit/shakeit.qml
+++ b/examples/sensors/shakeit/shakeit.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
//! [0]
-import QtMobility.sensors 1.3
+import QtSensors 5.0
//! [0]
import QtMultimedia 5.0
diff --git a/src/imports/sensors/qmlaccelerometer.cpp b/src/imports/sensors/qmlaccelerometer.cpp
index 8b6caacb..3771dc3f 100644
--- a/src/imports/sensors/qmlaccelerometer.cpp
+++ b/src/imports/sensors/qmlaccelerometer.cpp
@@ -46,9 +46,9 @@
\qmltype Accelerometer
\instantiates QmlAccelerometer
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The Accelerometer element reports on linear acceleration
along the X, Y and Z axes.
@@ -85,9 +85,9 @@ QSensor *QmlAccelerometer::sensor() const
\qmltype AccelerometerReading
\instantiates QmlAccelerometerReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The AccelerometerReading element holds the most recent Accelerometer reading.
The AccelerometerReading element holds the most recent Accelerometer reading.
@@ -109,7 +109,7 @@ QmlAccelerometerReading::~QmlAccelerometerReading()
}
/*!
- \qmlproperty qreal QtMobility.sensors1::AccelerometerReading::x
+ \qmlproperty qreal QtSensors::AccelerometerReading::x
This property holds the acceleration on the X axis.
Please see QAccelerometerReading::x for information about this property.
@@ -121,7 +121,7 @@ qreal QmlAccelerometerReading::x() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::AccelerometerReading::y
+ \qmlproperty qreal QtSensors::AccelerometerReading::y
This property holds the acceleration on the Y axis.
Please see QAccelerometerReading::y for information about this property.
@@ -133,7 +133,7 @@ qreal QmlAccelerometerReading::y() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::AccelerometerReading::z
+ \qmlproperty qreal QtSensors::AccelerometerReading::z
This property holds the acceleration on the Z axis.
Please see QAccelerometerReading::z for information about this property.
diff --git a/src/imports/sensors/qmlambientlightsensor.cpp b/src/imports/sensors/qmlambientlightsensor.cpp
index 784c8b1e..9cd9b356 100644
--- a/src/imports/sensors/qmlambientlightsensor.cpp
+++ b/src/imports/sensors/qmlambientlightsensor.cpp
@@ -46,9 +46,9 @@
\qmltype AmbientLightSensor
\instantiates QmlAmbientLightSensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The AmbientLightSensor element repors on ambient lighting conditions.
The AmbientLightSensor element repors on ambient lighting conditions.
@@ -83,9 +83,9 @@ QSensor *QmlAmbientLightSensor::sensor() const
\qmltype AmbientLightReading
\instantiates QmlAmbientLightSensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The AmbientLightReading element holds the most AmbientLightSensor reading.
The AmbientLightReading element holds the most AmbientLightSensor reading.
@@ -107,7 +107,7 @@ QmlAmbientLightSensorReading::~QmlAmbientLightSensorReading()
}
/*!
- \qmlproperty LightLevel QtMobility.sensors1::AmbientLightReading::lightLevel
+ \qmlproperty LightLevel QtSensors::AmbientLightReading::lightLevel
This property holds the ambient light level.
Please see QAmbientLightReading::lightLevel for information about this property.
diff --git a/src/imports/sensors/qmlcompass.cpp b/src/imports/sensors/qmlcompass.cpp
index 886e7c74..959cd36b 100644
--- a/src/imports/sensors/qmlcompass.cpp
+++ b/src/imports/sensors/qmlcompass.cpp
@@ -46,9 +46,9 @@
\qmltype Compass
\instantiates QmlCompass
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The Compass element reports on heading using magnetic north as a reference.
The Compass element reports on heading using magnetic north as a reference.
@@ -83,9 +83,9 @@ QSensor *QmlCompass::sensor() const
\qmltype CompassReading
\instantiates QmlCompassReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The CompassReading element holds the most recent Compass reading.
The CompassReading element holds the most recent Compass reading.
@@ -107,7 +107,7 @@ QmlCompassReading::~QmlCompassReading()
}
/*!
- \qmlproperty qreal QtMobility.sensors1::CompassReading::azimuth
+ \qmlproperty qreal QtSensors::CompassReading::azimuth
This property holds the azimuth of the device.
Please see QCompassReading::azimuth for information about this property.
@@ -119,7 +119,7 @@ qreal QmlCompassReading::azimuth() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::CompassReading::calibrationLevel
+ \qmlproperty qreal QtSensors::CompassReading::calibrationLevel
This property holds the calibration level of the reading.
Please see QCompassReading::calibrationLevel for information about this property.
diff --git a/src/imports/sensors/qmldir b/src/imports/sensors/qmldir
index a84a2d32..d4648a87 100644
--- a/src/imports/sensors/qmldir
+++ b/src/imports/sensors/qmldir
@@ -1,3 +1,3 @@
-module QtMobility.sensors
+module QtSensors
plugin declarative_sensors
typeinfo plugins.qmltypes
diff --git a/src/imports/sensors/qmlgyroscope.cpp b/src/imports/sensors/qmlgyroscope.cpp
index b52badb3..a60a7eb8 100644
--- a/src/imports/sensors/qmlgyroscope.cpp
+++ b/src/imports/sensors/qmlgyroscope.cpp
@@ -46,9 +46,9 @@
\qmltype Gyroscope
\instantiates QmlGyroscope
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.2
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The Gyroscope element reports on rotational acceleration
around the X, Y and Z axes.
@@ -82,9 +82,9 @@ QSensor *QmlGyroscope::sensor() const
\qmltype GyroscopeReading
\instantiates QmlGyroscopeReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.2
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The GyroscopeReading element holds the most recent Gyroscope reading.
The GyroscopeReading element holds the most recent Gyroscope reading.
@@ -106,7 +106,7 @@ QmlGyroscopeReading::~QmlGyroscopeReading()
}
/*!
- \qmlproperty qreal QtMobility.sensors1::GyroscopeReading::x
+ \qmlproperty qreal QtSensors::GyroscopeReading::x
This property holds the angular velocity around the x axis.
Please see QGyroscopeReading::x for information about this property.
@@ -118,7 +118,7 @@ qreal QmlGyroscopeReading::x() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::GyroscopeReading::y
+ \qmlproperty qreal QtSensors::GyroscopeReading::y
This property holds the angular velocity around the y axis.
Please see QGyroscopeReading::y for information about this property.
@@ -130,7 +130,7 @@ qreal QmlGyroscopeReading::y() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::GyroscopeReading::z
+ \qmlproperty qreal QtSensors::GyroscopeReading::z
This property holds the angular velocity around the z axis.
Please see QGyroscopeReading::z for information about this property.
diff --git a/src/imports/sensors/qmlirproximitysensor.cpp b/src/imports/sensors/qmlirproximitysensor.cpp
index 6c86872e..00dbabb7 100644
--- a/src/imports/sensors/qmlirproximitysensor.cpp
+++ b/src/imports/sensors/qmlirproximitysensor.cpp
@@ -46,9 +46,9 @@
\qmltype IRProximitySensor
\instantiates QmlIRProximitySensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.3
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The IRProximitySensor element reports on infra-red reflectance values.
This element wraps the QIRProximitySensor class. Please see the documentation for
@@ -81,9 +81,9 @@ QSensor *QmlIRProximitySensor::sensor() const
\qmltype IRProximityReading
\instantiates QmlIRProximitySensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.3
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The IRProximityReading element holds the most recent IR proximity reading.
The IRProximityReading element holds the most recent IR proximity reading.
@@ -105,7 +105,7 @@ QmlIRProximitySensorReading::~QmlIRProximitySensorReading()
}
/*!
- \qmlproperty qreal QtMobility.sensors1::IRProximityReading::reflectance
+ \qmlproperty qreal QtSensors::IRProximityReading::reflectance
This property holds the reflectance value.
Please see QIRProximityReading::reflectance for information about this property.
diff --git a/src/imports/sensors/qmllightsensor.cpp b/src/imports/sensors/qmllightsensor.cpp
index 6992ea58..b1995772 100644
--- a/src/imports/sensors/qmllightsensor.cpp
+++ b/src/imports/sensors/qmllightsensor.cpp
@@ -46,9 +46,9 @@
\qmltype LightSensor
\instantiates QmlLightSensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.2
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The LightSensor element reports on light levels using LUX.
The LightSensor element reports on light levels using LUX.
@@ -80,7 +80,7 @@ QSensor *QmlLightSensor::sensor() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::LightSensor::fieldOfView
+ \qmlproperty qreal QtSensors::LightSensor::fieldOfView
This property holds a value indicating the field of view.
Please see QLightSensor::fieldOfView for information about this property.
@@ -101,9 +101,9 @@ void QmlLightSensor::_update()
\qmltype LightReading
\instantiates QmlLightSensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.2
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The LightReading element holds the most recent LightSensor reading.
The LightReading element holds the most recent LightSensor reading.
diff --git a/src/imports/sensors/qmlmagnetometer.cpp b/src/imports/sensors/qmlmagnetometer.cpp
index c266e6ac..f2eef9a9 100644
--- a/src/imports/sensors/qmlmagnetometer.cpp
+++ b/src/imports/sensors/qmlmagnetometer.cpp
@@ -46,9 +46,9 @@
\qmltype Magnetometer
\instantiates QmlMagnetometer
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The Magnetometer element reports on magnetic field strength
along the Z, Y and Z axes.
@@ -82,7 +82,7 @@ QSensor *QmlMagnetometer::sensor() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::Magnetometer::returnGeoValues
+ \qmlproperty bool QtSensors::Magnetometer::returnGeoValues
This property holds a value indicating if geomagnetic values should be returned.
Please see QMagnetometer::returnGeoValues for information about this property.
@@ -103,9 +103,9 @@ void QmlMagnetometer::setReturnGeoValues(bool geo)
\qmltype MagnetometerReading
\instantiates QmlMagnetometerReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The MagnetometerReading element holds the most recent Magnetometer reading.
The MagnetometerReading element holds the most recent Magnetometer reading.
@@ -127,7 +127,7 @@ QmlMagnetometerReading::~QmlMagnetometerReading()
}
/*!
- \qmlproperty qreal QtMobility.sensors1::MagnetometerReading::x
+ \qmlproperty qreal QtSensors::MagnetometerReading::x
This property holds the raw magnetic flux density on the X axis.
Please see QMagnetometerReading::x for information about this property.
@@ -139,7 +139,7 @@ qreal QmlMagnetometerReading::x() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::MagnetometerReading::y
+ \qmlproperty qreal QtSensors::MagnetometerReading::y
This property holds the raw magnetic flux density on the Y axis.
Please see QMagnetometerReading::y for information about this property.
@@ -151,7 +151,7 @@ qreal QmlMagnetometerReading::y() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::MagnetometerReading::z
+ \qmlproperty qreal QtSensors::MagnetometerReading::z
This property holds the raw magnetic flux density on the Z axis.
Please see QMagnetometerReading::z for information about this property.
@@ -163,7 +163,7 @@ qreal QmlMagnetometerReading::z() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::MagnetometerReading::calibrationLevel
+ \qmlproperty qreal QtSensors::MagnetometerReading::calibrationLevel
This property holds the accuracy of the reading.
Please see QMagnetometerReading::calibrationLevel for information about this property.
diff --git a/src/imports/sensors/qmlorientationsensor.cpp b/src/imports/sensors/qmlorientationsensor.cpp
index 9db69c19..a51dd87c 100644
--- a/src/imports/sensors/qmlorientationsensor.cpp
+++ b/src/imports/sensors/qmlorientationsensor.cpp
@@ -46,9 +46,9 @@
\qmltype OrientationSensor
\instantiates QmlOrientationSensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The OrientationSensor element reports device orientation.
The OrientationSensor element reports device orientation.
@@ -83,9 +83,9 @@ QSensor *QmlOrientationSensor::sensor() const
\qmltype OrientationReading
\instantiates QmlOrientationSensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The OrientationReading element holds the most recent OrientationSensor reading.
The OrientationReading element holds the most recent OrientationSensor reading.
@@ -107,7 +107,7 @@ QmlOrientationSensorReading::~QmlOrientationSensorReading()
}
/*!
- \qmlproperty Orientation QtMobility.sensors1::OrientationReading::orientation
+ \qmlproperty Orientation QtSensors::OrientationReading::orientation
This property holds the orientation of the device.
Please see QOrientationReading::orientation for information about this property.
diff --git a/src/imports/sensors/qmlproximitysensor.cpp b/src/imports/sensors/qmlproximitysensor.cpp
index fa06f80a..e6ffc644 100644
--- a/src/imports/sensors/qmlproximitysensor.cpp
+++ b/src/imports/sensors/qmlproximitysensor.cpp
@@ -46,9 +46,9 @@
\qmltype ProximitySensor
\instantiates QmlProximitySensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The ProximitySensor element reports on object proximity.
The ProximitySensor element reports on object proximity.
@@ -83,9 +83,9 @@ QSensor *QmlProximitySensor::sensor() const
\qmltype ProximityReading
\instantiates QmlProximitySensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The ProximityReading element holds the most recent ProximitySensor reading.
The ProximityReading element holds the most recent ProximitySensor reading.
diff --git a/src/imports/sensors/qmlrotationsensor.cpp b/src/imports/sensors/qmlrotationsensor.cpp
index 745af81c..cb7d47a6 100644
--- a/src/imports/sensors/qmlrotationsensor.cpp
+++ b/src/imports/sensors/qmlrotationsensor.cpp
@@ -46,9 +46,9 @@
\qmltype RotationSensor
\instantiates QmlRotationSensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The RotationSensor element reports on device rotation
around the X, Y and Z axes.
@@ -82,7 +82,7 @@ QSensor *QmlRotationSensor::sensor() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::RotationSensor::hasZ
+ \qmlproperty qreal QtSensors::RotationSensor::hasZ
This property holds a value indicating if the z angle is available.
Please see QRotationSensor::hasZ for information about this property.
@@ -101,9 +101,9 @@ void QmlRotationSensor::_update()
\qmltype RotationReading
\instantiates QmlRotationSensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The RotationReading element holds the most recent RotationSensor reading.
The RotationReading element holds the most recent RotationSensor reading.
@@ -125,7 +125,7 @@ QmlRotationSensorReading::~QmlRotationSensorReading()
}
/*!
- \qmlproperty qreal QtMobility.sensors1::RotationReading::x
+ \qmlproperty qreal QtSensors::RotationReading::x
This property holds the rotation around the x axis.
Please see QRotationReading::x for information about this property.
@@ -137,7 +137,7 @@ qreal QmlRotationSensorReading::x() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::RotationReading::y
+ \qmlproperty qreal QtSensors::RotationReading::y
This property holds the rotation around the y axis.
Please see QRotationReading::y for information about this property.
@@ -149,7 +149,7 @@ qreal QmlRotationSensorReading::y() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::RotationReading::z
+ \qmlproperty qreal QtSensors::RotationReading::z
This property holds the rotation around the z axis.
Please see QRotationReading::z for information about this property.
diff --git a/src/imports/sensors/qmlsensor.cpp b/src/imports/sensors/qmlsensor.cpp
index 217b5dc2..e12171ae 100644
--- a/src/imports/sensors/qmlsensor.cpp
+++ b/src/imports/sensors/qmlsensor.cpp
@@ -48,8 +48,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Sensor
\instantiates QmlSensor
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
\brief The Sensor element serves as a base type for sensors.
The Sensor element serves as a base type for sensors.
@@ -92,7 +92,7 @@ void QmlSensor::setIdentifier(const QString &identifier)
}
/*!
- \qmlproperty string QtMobility.sensors1::Sensor::type
+ \qmlproperty string QtSensors::Sensor::type
This property holds the type of the sensor.
*/
@@ -102,7 +102,7 @@ QString QmlSensor::type() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::Sensor::connectedToBackend
+ \qmlproperty bool QtSensors::Sensor::connectedToBackend
This property holds a value indicating if the sensor has connected to a backend.
Please see QSensor::connectedToBackend for information about this property.
@@ -114,7 +114,7 @@ bool QmlSensor::isConnectedToBackend() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::Sensor::busy
+ \qmlproperty bool QtSensors::Sensor::busy
This property holds a value to indicate if the sensor is busy.
Please see QSensor::busy for information about this property.
@@ -126,7 +126,7 @@ bool QmlSensor::isBusy() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::Sensor::active
+ \qmlproperty bool QtSensors::Sensor::active
This property holds a value to indicate if the sensor is active.
Please see QSensor::active for information about this property.
@@ -154,7 +154,7 @@ bool QmlSensor::isActive() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::Sensor::alwaysOn
+ \qmlproperty bool QtSensors::Sensor::alwaysOn
This property holds a value to indicate if the sensor should remain running when the screen is off.
Please see QSensor::alwaysOn for information about this property.
@@ -171,7 +171,7 @@ void QmlSensor::setAlwaysOn(bool alwaysOn)
}
/*!
- \qmlproperty list<Range> QtMobility.sensors1::Sensor::availableDataRates
+ \qmlproperty list<Range> QtSensors::Sensor::availableDataRates
This property holds the data rates that the sensor supports.
Please see QSensor::availableDataRates for information about this property.
@@ -192,7 +192,7 @@ QQmlListProperty<QmlSensorRange> QmlSensor::availableDataRates() const
}
/*!
- \qmlproperty int QtMobility.sensors1::Sensor::dataRate
+ \qmlproperty int QtSensors::Sensor::dataRate
This property holds the data rate that the sensor should be run at.
Please see QSensor::dataRate for information about this property.
@@ -212,7 +212,7 @@ void QmlSensor::setDataRate(int rate)
}
/*!
- \qmlproperty list<OutputRange> QtMobility.sensors1::Sensor::outputRanges
+ \qmlproperty list<OutputRange> QtSensors::Sensor::outputRanges
This property holds a list of output ranges the sensor supports.
Please see QSensor::outputRanges for information about this property.
@@ -234,7 +234,7 @@ QQmlListProperty<QmlSensorOutputRange> QmlSensor::outputRanges() const
}
/*!
- \qmlproperty int QtMobility.sensors1::Sensor::outputRange
+ \qmlproperty int QtSensors::Sensor::outputRange
This property holds the output range in use by the sensor.
Please see QSensor::outputRange for information about this property.
@@ -255,7 +255,7 @@ void QmlSensor::setOutputRange(int index)
}
/*!
- \qmlproperty string QtMobility.sensors1::Sensor::description
+ \qmlproperty string QtSensors::Sensor::description
This property holds a descriptive string for the sensor.
*/
@@ -265,7 +265,7 @@ QString QmlSensor::description() const
}
/*!
- \qmlproperty int QtMobility.sensors1::Sensor::error
+ \qmlproperty int QtSensors::Sensor::error
This property holds the last error code set on the sensor.
*/
@@ -275,7 +275,7 @@ int QmlSensor::error() const
}
/*!
- \qmlproperty SensorReading QtMobility.sensors1::Sensor::reading
+ \qmlproperty SensorReading QtSensors::Sensor::reading
This property holds the reading class.
Please see QSensor::reading for information about this property.
@@ -288,7 +288,7 @@ QmlSensorReading *QmlSensor::reading() const
}
/*!
- \qmlmethod bool QtMobility.sensors1::Sensor::start()
+ \qmlmethod bool QtSensors::Sensor::start()
Start retrieving values from the sensor. Returns true if the sensor was started, false otherwise.
Please see QSensor::start() for information.
@@ -301,7 +301,7 @@ bool QmlSensor::start()
}
/*!
- \qmlmethod bool QtMobility.sensors1::Sensor::stop()
+ \qmlmethod bool QtSensors::Sensor::stop()
Stop retrieving values from the sensor.
Please see QSensor::stop() for information.
@@ -380,8 +380,8 @@ void QmlSensor::updateReading()
/*!
\qmltype SensorReading
\instantiates QmlSensorReading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
\brief The SensorReading element serves as a base type for sensor readings.
The SensorReading element serves as a base type for sensor readings.
@@ -402,7 +402,7 @@ QmlSensorReading::~QmlSensorReading()
}
/*!
- \qmlproperty quint64 QtMobility.sensors1::SensorReading::timestamp
+ \qmlproperty quint64 QtSensors::SensorReading::timestamp
A timestamp for the reading.
Please see QSensorReading::timestamp for information about this property.
diff --git a/src/imports/sensors/qmlsensorgesture.cpp b/src/imports/sensors/qmlsensorgesture.cpp
index 4f1b8367..2fae55e3 100644
--- a/src/imports/sensors/qmlsensorgesture.cpp
+++ b/src/imports/sensors/qmlsensorgesture.cpp
@@ -48,8 +48,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype SensorGesture
\instantiates QmlSensorGesture
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.3
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
\brief Provides notifications when sensor-based gestures are detected.
This type provides notification when sensor gestures are triggered.
@@ -117,7 +117,7 @@ void QmlSensorGesture::componentComplete()
*/
/*!
- \qmlproperty stringlist QtMobility.sensors1::SensorGesture::availableGestures
+ \qmlproperty stringlist QtSensors::SensorGesture::availableGestures
This property can be used to determine all available gestures on the system.
*/
QStringList QmlSensorGesture::availableGestures()
@@ -126,13 +126,13 @@ QStringList QmlSensorGesture::availableGestures()
}
/*!
- \qmlproperty stringlist QtMobility.sensors1::SensorGesture::gestures
+ \qmlproperty stringlist QtSensors::SensorGesture::gestures
Set this property to a list of the gestures that the application is interested in detecting.
This property cannot be changed while the type is enabled.
The properties validGestures and invalidGestures will be set as appropriate immediately.
To determine all available getures on the system please use the
- \l {QtMobility.sensors1::SensorGesture::availableGestures} {availableGestures} property.
+ \l {QtSensors::SensorGesture::availableGestures} {availableGestures} property.
\sa {QtSensorGestures Plugins}
*/
@@ -157,7 +157,7 @@ void QmlSensorGesture::setGestures(const QStringList& value)
/*!
- \qmlproperty stringlist QtMobility.sensors1::SensorGesture::validGestures
+ \qmlproperty stringlist QtSensors::SensorGesture::validGestures
This property holds the requested gestures that were found on the system.
*/
QStringList QmlSensorGesture::validGestures() const
@@ -168,7 +168,7 @@ QStringList QmlSensorGesture::validGestures() const
}
/*!
- \qmlproperty stringlist QtMobility.sensors1::SensorGesture::invalidGestures
+ \qmlproperty stringlist QtSensors::SensorGesture::invalidGestures
This property holds the requested gestures that were not found on the system.
*/
QStringList QmlSensorGesture::invalidGestures() const
@@ -179,10 +179,10 @@ QStringList QmlSensorGesture::invalidGestures() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::SensorGesture::enabled
+ \qmlproperty bool QtSensors::SensorGesture::enabled
This property can be used to activate or deactivate the sensor gesture.
Default value is false;
- \sa {QtMobility.sensors1::SensorGesture::detected}, {detected}
+ \sa {QtSensors::SensorGesture::detected}, {detected}
*/
bool QmlSensorGesture::enabled() const
{
@@ -211,7 +211,7 @@ void QmlSensorGesture::setEnabled(bool value)
}
/*!
- \qmlsignal QtMobility.sensors1::SensorGesture::detected(string gesture)
+ \qmlsignal QtSensors::SensorGesture::detected(string gesture)
This signal is emitted whenever a gesture is detected.
The gesture parameter contains the gesture that was detected.
*/
diff --git a/src/imports/sensors/qmlsensorglobal.cpp b/src/imports/sensors/qmlsensorglobal.cpp
index 5c9723af..9f26e419 100644
--- a/src/imports/sensors/qmlsensorglobal.cpp
+++ b/src/imports/sensors/qmlsensorglobal.cpp
@@ -47,8 +47,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype SensorGlobal
\instantiates QmlSensorGlobal
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.3
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
\brief The SensorGlobal element provides the module API.
The SensorGlobal element provides the module API.
@@ -56,8 +56,8 @@ QT_BEGIN_NAMESPACE
This element cannot be directly created. It can only be accessed via a namespace import.
\code
- import QtMobility.sensors 1.3
- import QtMobility.sensors 1.3 as Sensors
+ import QtSensors 5.0
+ import QtSensors 5.0 as Sensors
...
Component.onCompleted: {
var types = Sensors.sensorTypes();
@@ -78,7 +78,7 @@ QmlSensorGlobal::~QmlSensorGlobal()
}
/*!
- \qmlmethod list<string> QtMobility.sensors1::SensorGlobal::sensorTypes()
+ \qmlmethod list<string> QtSensors::SensorGlobal::sensorTypes()
Returns a list of the sensor types that have been registered.
Please see QSensor::sensorTypes() for information.
@@ -92,7 +92,7 @@ QStringList QmlSensorGlobal::sensorTypes() const
}
/*!
- \qmlmethod list<string> QtMobility.sensors1::SensorGlobal::sensorsForType(type)
+ \qmlmethod list<string> QtSensors::SensorGlobal::sensorsForType(type)
Returns a list of the sensor identifiers that have been registered for \a type.
Please see QSensor::sensorsForType() for information.
@@ -106,7 +106,7 @@ QStringList QmlSensorGlobal::sensorsForType(const QString &type) const
}
/*!
- \qmlmethod string QtMobility.sensors1::SensorGlobal::defaultSensorForType(type)
+ \qmlmethod string QtSensors::SensorGlobal::defaultSensorForType(type)
Returns the default sensor identifier that has been registered for \a type.
Please see QSensor::defaultSensorForType() for information.
diff --git a/src/imports/sensors/qmltapsensor.cpp b/src/imports/sensors/qmltapsensor.cpp
index ac17df09..6e00f386 100644
--- a/src/imports/sensors/qmltapsensor.cpp
+++ b/src/imports/sensors/qmltapsensor.cpp
@@ -46,9 +46,9 @@
\qmltype TapSensor
\instantiates QmlTapSensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The TapSensor element reports tap and double tap events
along the X, Y and Z axes.
@@ -82,7 +82,7 @@ QSensor *QmlTapSensor::sensor() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::TapSensor::returnDoubleTapEvents
+ \qmlproperty bool QtSensors::TapSensor::returnDoubleTapEvents
This property holds a value indicating if double tap events should be reported.
Please see QTapSensor::returnDoubleTapEvents for information about this property.
@@ -104,9 +104,9 @@ void QmlTapSensor::setReturnDoubleTapEvents(bool ret)
\qmltype TapReading
\instantiates QmlTapSensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The TapReading element holds the most recent TapSensor reading.
The TapReading element holds the most recent TapSensor reading.
@@ -128,7 +128,7 @@ QmlTapSensorReading::~QmlTapSensorReading()
}
/*!
- \qmlproperty TapDirection QtMobility.sensors1::TapReading::tapDirection
+ \qmlproperty TapDirection QtSensors::TapReading::tapDirection
This property holds the direction of the tap.
Please see QTapReading::tapDirection for information about this property.
@@ -150,7 +150,7 @@ QTapReading::TapDirection QmlTapSensorReading::tapDirection() const
}
/*!
- \qmlproperty bool QtMobility.sensors1::TapReading::doubleTap
+ \qmlproperty bool QtSensors::TapReading::doubleTap
This property holds a value indicating if there was a single or double tap.
Please see QTapReading::doubleTap for information about this property.
diff --git a/src/imports/sensors/qmltiltsensor.cpp b/src/imports/sensors/qmltiltsensor.cpp
index 39871044..34a3bc2f 100644
--- a/src/imports/sensors/qmltiltsensor.cpp
+++ b/src/imports/sensors/qmltiltsensor.cpp
@@ -49,9 +49,9 @@ QT_END_NAMESPACE
\qmltype TiltSensor
\instantiates QmlTiltSensor
\ingroup qml-sensors_type
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::Sensor
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::Sensor
\brief The TiltSensor element reports tilt events
along the X and Y axes.
@@ -84,7 +84,7 @@ QSensor *QmlTiltSensor::sensor() const
}
/*!
- \qmlmethod QtMobility.sensors1::TiltSensor::calibrate()
+ \qmlmethod QtSensors::TiltSensor::calibrate()
Calibrate the tilt sensor.
Please see QTiltSensor::calibrate() for information about this property.
@@ -98,9 +98,9 @@ void QmlTiltSensor::calibrate()
\qmltype TiltReading
\instantiates QmlTiltSensorReading
\ingroup qml-sensors_reading
- \inqmlmodule QtMobility.sensors 1.3
- \since QtMobility.sensors 1.1
- \inherits QtMobility.sensors1::SensorReading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.0
+ \inherits QtSensors::SensorReading
\brief The TiltReading element holds the most recent TiltSensor reading.
The TiltReading element holds the most recent TiltSensor reading.
@@ -122,7 +122,7 @@ QmlTiltSensorReading::~QmlTiltSensorReading()
}
/*!
- \qmlproperty qreal QtMobility.sensors1::TiltReading::yRotation
+ \qmlproperty qreal QtSensors::TiltReading::yRotation
This property holds the amount of tilt on the Y axis.
Please see QTiltReading::yRotation for information about this property.
@@ -134,7 +134,7 @@ qreal QmlTiltSensorReading::yRotation() const
}
/*!
- \qmlproperty qreal QtMobility.sensors1::TiltReading::xRotation
+ \qmlproperty qreal QtSensors::TiltReading::xRotation
This property holds the amount of tilt on the X axis.
Please see QTiltReading::xRotation for information about this property.
diff --git a/src/imports/sensors/sensors.cpp b/src/imports/sensors/sensors.cpp
index 9c0c864b..50ccdf93 100644
--- a/src/imports/sensors/sensors.cpp
+++ b/src/imports/sensors/sensors.cpp
@@ -74,7 +74,7 @@
QT_BEGIN_NAMESPACE
-static QObject *global_object_13(QQmlEngine *, QJSEngine *)
+static QObject *global_object_50(QQmlEngine *, QJSEngine *)
{
return new QmlSensorGlobal;
}
@@ -86,62 +86,15 @@ class QtSensorsDeclarativeModule : public QQmlExtensionPlugin
public:
virtual void registerTypes(const char *uri)
{
- char const * const package = "QtMobility.sensors";
+ char const * const package = "QtSensors";
if (QLatin1String(uri) != QLatin1String(package)) return;
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;
- 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"));
-
- // Register the 1.3 interfaces
- major = 1;
- minor = 3;
- qmlRegisterSingletonType <QmlSensorGlobal >(package, major, minor, "QtSensors", global_object_13);
+ // Register the 5.0 interfaces
+ major = 5;
+ minor = 0;
+ qmlRegisterSingletonType <QmlSensorGlobal >(package, major, minor, "QmlSensors", global_object_50);
qmlRegisterUncreatableType<QmlSensorRange >(package, major, minor, "Range", QLatin1String("Cannot create Range"));
qmlRegisterUncreatableType<QmlSensorOutputRange >(package, major, minor, "OutputRange", QLatin1String("Cannot create OutputRange"));
qmlRegisterUncreatableType<QmlSensor >(package, major, minor, "Sensor", QLatin1String("Cannot create Sensor"));
diff --git a/src/imports/sensors/sensors.pro b/src/imports/sensors/sensors.pro
index 0d08bf3c..d479922a 100644
--- a/src/imports/sensors/sensors.pro
+++ b/src/imports/sensors/sensors.pro
@@ -1,7 +1,7 @@
CXX_MODULE = sensors
TARGET = declarative_sensors
-TARGETPATH = QtMobility/sensors
-IMPORT_VERSION = 1.3 # Doesn't matter, as long as it's a valid version?!
+TARGETPATH = QtSensors
+IMPORT_VERSION = 5.0 # Doesn't matter, as long as it's a valid version?!
include(qsensorsimport.pri)
diff --git a/src/sensors/gestures/qsensorgestureplugininterface.cpp b/src/sensors/gestures/qsensorgestureplugininterface.cpp
index b69c81c9..add34c0e 100644
--- a/src/sensors/gestures/qsensorgestureplugininterface.cpp
+++ b/src/sensors/gestures/qsensorgestureplugininterface.cpp
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
\brief The QSensorGesturePluginInterface class is the pure virtual interface to sensor gesture
plugins.
- \since QtMobility.sensors 1.3
+ \since QtSensors 5.0
The QSensorGesturePluginInterface class is implemented in sensor gesture plugins to register
sensor gesture recognizers with QSensorGestureManager.
diff --git a/tests/auto/legacy_sensors/tst_legacy_sensors.cpp b/tests/auto/legacy_sensors/tst_legacy_sensors.cpp
index cf9913c8..0e4e9e58 100644
--- a/tests/auto/legacy_sensors/tst_legacy_sensors.cpp
+++ b/tests/auto/legacy_sensors/tst_legacy_sensors.cpp
@@ -70,10 +70,7 @@ private slots:
QTest::addColumn<QString>("version");
QTest::addColumn<bool>("exists");
- QTest::newRow("1.0") << "1.0" << false;
- QTest::newRow("1.1") << "1.1" << true;
- QTest::newRow("1.2") << "1.2" << true;
- QTest::newRow("1.3") << "1.3" << true;
+ QTest::newRow("5.0") << "5.0" << true;
}
void versions()
@@ -82,7 +79,7 @@ private slots:
QFETCH(bool, exists);
QQmlEngine engine;
- QString qml = QString("import QtQuick 2.0\nimport QtMobility.sensors %1\nItem {}").arg(version);
+ QString qml = QString("import QtQuick 2.0\nimport QtSensors %1\nItem {}").arg(version);
QQmlComponent c(&engine);
c.setData(qml.toLocal8Bit(), QUrl::fromLocalFile(QDir::currentPath()));
if (!exists)
@@ -95,7 +92,7 @@ private slots:
QCOMPARE(errors.count(), 0);
} else {
QCOMPARE(errors.count(), 1);
- QString expected = QString("module \"QtMobility.sensors\" version %1 is not installed").arg(version);
+ QString expected = QString("module \"QtSensors\" version %1 is not installed").arg(version);
QString actual = errors.first().description();
QCOMPARE(expected, actual);
}
@@ -107,76 +104,36 @@ private slots:
QTest::addColumn<QString>("element");
QTest::addColumn<bool>("exists");
- QTest::newRow("1.1 SensorReading") << "1.1" << "SensorReading" << false;
- QTest::newRow("1.1 Accelerometer") << "1.1" << "Accelerometer" << true;
- QTest::newRow("1.1 AccelerometerReading") << "1.1" << "AccelerometerReading" << true;
- QTest::newRow("1.1 AmbientLightSensor") << "1.1" << "AmbientLightSensor" << true;
- QTest::newRow("1.1 AmbientLightReading") << "1.1" << "AmbientLightReading" << true;
- QTest::newRow("1.1 Compass") << "1.1" << "Compass" << true;
- QTest::newRow("1.1 CompassReading") << "1.1" << "CompassReading" << true;
- QTest::newRow("1.1 Magnetometer") << "1.1" << "Magnetometer" << true;
- QTest::newRow("1.1 MagnetometerReading") << "1.1" << "MagnetometerReading" << true;
- QTest::newRow("1.1 OrientationSensor") << "1.1" << "OrientationSensor" << true;
- QTest::newRow("1.1 OrientationReading") << "1.1" << "OrientationReading" << true;
- QTest::newRow("1.1 ProximitySensor") << "1.1" << "ProximitySensor" << true;
- QTest::newRow("1.1 ProximityReading") << "1.1" << "ProximityReading" << true;
- QTest::newRow("1.1 RotationSensor") << "1.1" << "RotationSensor" << true;
- QTest::newRow("1.1 RotationReading") << "1.1" << "RotationReading" << true;
- QTest::newRow("1.1 TapSensor") << "1.1" << "TapSensor" << true;
- QTest::newRow("1.1 TapReading") << "1.1" << "TapReading" << true;
+ QTest::newRow("5.0 Range") << "5.0" << "Range" << false;
+ QTest::newRow("5.0 OutputRange") << "5.0" << "OutputRange" << false;
+ QTest::newRow("5.0 Sensor") << "5.0" << "Sensor" << false;
+ QTest::newRow("5.0 SensorReading") << "5.0" << "SensorReading" << false;
+ QTest::newRow("5.0 Accelerometer") << "5.0" << "Accelerometer" << true;
+ QTest::newRow("5.0 AccelerometerReading") << "5.0" << "AccelerometerReading" << false;
+ QTest::newRow("5.0 AmbientLightSensor") << "5.0" << "AmbientLightSensor" << true;
+ QTest::newRow("5.0 AmbientLightReading") << "5.0" << "AmbientLightReading" << false;
+ QTest::newRow("5.0 Compass") << "5.0" << "Compass" << true;
+ QTest::newRow("5.0 CompassReading") << "5.0" << "CompassReading" << false;
+ QTest::newRow("5.0 Magnetometer") << "5.0" << "Magnetometer" << true;
+ QTest::newRow("5.0 MagnetometerReading") << "5.0" << "MagnetometerReading" << false;
+ QTest::newRow("5.0 OrientationSensor") << "5.0" << "OrientationSensor" << true;
+ QTest::newRow("5.0 OrientationReading") << "5.0" << "OrientationReading" << false;
+ QTest::newRow("5.0 ProximitySensor") << "5.0" << "ProximitySensor" << true;
+ QTest::newRow("5.0 ProximityReading") << "5.0" << "ProximityReading" << false;
+ QTest::newRow("5.0 RotationSensor") << "5.0" << "RotationSensor" << true;
+ QTest::newRow("5.0 RotationReading") << "5.0" << "RotationReading" << false;
+ QTest::newRow("5.0 TapSensor") << "5.0" << "TapSensor" << true;
+ QTest::newRow("5.0 TapReading") << "5.0" << "TapReading" << false;
+ QTest::newRow("5.0 LightSensor") << "5.0" << "LightSensor" << true;
+ QTest::newRow("5.0 LightReading") << "5.0" << "LightReading" << false;
+ QTest::newRow("5.0 Gyroscope") << "5.0" << "Gyroscope" << true;
+ QTest::newRow("5.0 GyroscopeReading") << "5.0" << "GyroscopeReading" << false;
+ QTest::newRow("5.0 IRProximitySensor") << "5.0" << "IRProximitySensor" << true;
+ QTest::newRow("5.0 IRProximityReading") << "5.0" << "IRProximityReading" << false;
+ QTest::newRow("5.0 TiltSensor") << "5.0" << "TiltSensor" << true;
+ QTest::newRow("5.0 TiltReading") << "5.0" << "TiltReading" << false;
- QTest::newRow("1.2 SensorReading") << "1.2" << "SensorReading" << false;
- QTest::newRow("1.2 Accelerometer") << "1.2" << "Accelerometer" << true;
- QTest::newRow("1.2 AccelerometerReading") << "1.2" << "AccelerometerReading" << false;
- QTest::newRow("1.2 AmbientLightSensor") << "1.2" << "AmbientLightSensor" << true;
- QTest::newRow("1.2 AmbientLightReading") << "1.2" << "AmbientLightReading" << false;
- QTest::newRow("1.2 Compass") << "1.2" << "Compass" << true;
- QTest::newRow("1.2 CompassReading") << "1.2" << "CompassReading" << false;
- QTest::newRow("1.2 Magnetometer") << "1.2" << "Magnetometer" << true;
- QTest::newRow("1.2 MagnetometerReading") << "1.2" << "MagnetometerReading" << false;
- QTest::newRow("1.2 OrientationSensor") << "1.2" << "OrientationSensor" << true;
- QTest::newRow("1.2 OrientationReading") << "1.2" << "OrientationReading" << false;
- QTest::newRow("1.2 ProximitySensor") << "1.2" << "ProximitySensor" << true;
- QTest::newRow("1.2 ProximityReading") << "1.2" << "ProximityReading" << false;
- QTest::newRow("1.2 RotationSensor") << "1.2" << "RotationSensor" << true;
- QTest::newRow("1.2 RotationReading") << "1.2" << "RotationReading" << false;
- QTest::newRow("1.2 TapSensor") << "1.2" << "TapSensor" << true;
- QTest::newRow("1.2 TapReading") << "1.2" << "TapReading" << false;
- QTest::newRow("1.2 LightSensor") << "1.2" << "LightSensor" << true;
- QTest::newRow("1.2 LightReading") << "1.2" << "LightReading" << false;
- QTest::newRow("1.2 Gyroscope") << "1.2" << "Gyroscope" << true;
- QTest::newRow("1.2 GyroscopeReading") << "1.2" << "GyroscopeReading" << false;
-
- QTest::newRow("1.3 Range") << "1.3" << "Range" << false;
- QTest::newRow("1.3 OutputRange") << "1.3" << "OutputRange" << false;
- QTest::newRow("1.3 Sensor") << "1.3" << "Sensor" << false;
- QTest::newRow("1.3 SensorReading") << "1.3" << "SensorReading" << false;
- QTest::newRow("1.3 Accelerometer") << "1.3" << "Accelerometer" << true;
- QTest::newRow("1.3 AccelerometerReading") << "1.3" << "AccelerometerReading" << false;
- QTest::newRow("1.3 AmbientLightSensor") << "1.3" << "AmbientLightSensor" << true;
- QTest::newRow("1.3 AmbientLightReading") << "1.3" << "AmbientLightReading" << false;
- QTest::newRow("1.3 Compass") << "1.3" << "Compass" << true;
- QTest::newRow("1.3 CompassReading") << "1.3" << "CompassReading" << false;
- QTest::newRow("1.3 Magnetometer") << "1.3" << "Magnetometer" << true;
- QTest::newRow("1.3 MagnetometerReading") << "1.3" << "MagnetometerReading" << false;
- QTest::newRow("1.3 OrientationSensor") << "1.3" << "OrientationSensor" << true;
- QTest::newRow("1.3 OrientationReading") << "1.3" << "OrientationReading" << false;
- QTest::newRow("1.3 ProximitySensor") << "1.3" << "ProximitySensor" << true;
- QTest::newRow("1.3 ProximityReading") << "1.3" << "ProximityReading" << false;
- QTest::newRow("1.3 RotationSensor") << "1.3" << "RotationSensor" << true;
- QTest::newRow("1.3 RotationReading") << "1.3" << "RotationReading" << false;
- QTest::newRow("1.3 TapSensor") << "1.3" << "TapSensor" << true;
- QTest::newRow("1.3 TapReading") << "1.3" << "TapReading" << false;
- QTest::newRow("1.3 LightSensor") << "1.3" << "LightSensor" << true;
- QTest::newRow("1.3 LightReading") << "1.3" << "LightReading" << false;
- QTest::newRow("1.3 Gyroscope") << "1.3" << "Gyroscope" << true;
- QTest::newRow("1.3 GyroscopeReading") << "1.3" << "GyroscopeReading" << false;
- QTest::newRow("1.3 IRProximitySensor") << "1.3" << "IRProximitySensor" << true;
- QTest::newRow("1.3 IRProximityReading") << "1.3" << "IRProximityReading" << false;
- QTest::newRow("1.3 TiltSensor") << "1.3" << "TiltSensor" << true;
- QTest::newRow("1.3 TiltReading") << "1.3" << "TiltReading" << false;
-
- QTest::newRow("1.3 SensorGesture") << "1.3" << "SensorGesture" << true;
+ QTest::newRow("5.0 SensorGesture") << "5.0" << "SensorGesture" << true;
}
void elements()
@@ -186,7 +143,7 @@ private slots:
QFETCH(bool, exists);
QQmlEngine engine;
- QString qml = QString("import QtQuick 2.0\nimport QtMobility.sensors %1\n%2 {}").arg(version).arg(element);
+ QString qml = QString("import QtQuick 2.0\nimport QtSensors %1\n%2 {}").arg(version).arg(element);
QQmlComponent c(&engine);
c.setData(qml.toLocal8Bit(), QUrl::fromLocalFile(QDir::currentPath()));
if (!exists)
@@ -211,38 +168,18 @@ private slots:
QTest::addColumn<QString>("element");
QTest::addColumn<bool>("validSyntax");
- QTest::newRow("1.1 Accelerometer") << "1.1" << "Accelerometer" << false;
- QTest::newRow("1.1 AmbientLightSensor") << "1.1" << "AmbientLightSensor" << false;
- QTest::newRow("1.1 Compass") << "1.1" << "Compass" << false;
- QTest::newRow("1.1 Magnetometer") << "1.1" << "Magnetometer" << false;
- QTest::newRow("1.1 OrientationSensor") << "1.1" << "OrientationSensor" << false;
- QTest::newRow("1.1 ProximitySensor") << "1.1" << "ProximitySensor" << false;
- QTest::newRow("1.1 RotationSensor") << "1.1" << "RotationSensor" << false;
- QTest::newRow("1.1 TapSensor") << "1.1" << "TapSensor" << false;
-
- QTest::newRow("1.2 Accelerometer") << "1.2" << "Accelerometer" << false;
- QTest::newRow("1.2 AmbientLightSensor") << "1.2" << "AmbientLightSensor" << false;
- QTest::newRow("1.2 Compass") << "1.2" << "Compass" << false;
- QTest::newRow("1.2 Magnetometer") << "1.2" << "Magnetometer" << false;
- QTest::newRow("1.2 OrientationSensor") << "1.2" << "OrientationSensor" << false;
- QTest::newRow("1.2 ProximitySensor") << "1.2" << "ProximitySensor" << false;
- QTest::newRow("1.2 RotationSensor") << "1.2" << "RotationSensor" << false;
- QTest::newRow("1.2 TapSensor") << "1.2" << "TapSensor" << false;
- QTest::newRow("1.2 LightSensor") << "1.2" << "LightSensor" << false;
- QTest::newRow("1.2 Gyroscope") << "1.2" << "Gyroscope" << false;
-
- QTest::newRow("1.3 Accelerometer") << "1.3" << "Accelerometer" << true;
- QTest::newRow("1.3 AmbientLightSensor") << "1.3" << "AmbientLightSensor" << true;
- QTest::newRow("1.3 Compass") << "1.3" << "Compass" << true;
- QTest::newRow("1.3 Magnetometer") << "1.3" << "Magnetometer" << true;
- QTest::newRow("1.3 OrientationSensor") << "1.3" << "OrientationSensor" << true;
- QTest::newRow("1.3 ProximitySensor") << "1.3" << "ProximitySensor" << true;
- QTest::newRow("1.3 RotationSensor") << "1.3" << "RotationSensor" << true;
- QTest::newRow("1.3 TapSensor") << "1.3" << "TapSensor" << true;
- QTest::newRow("1.3 LightSensor") << "1.3" << "LightSensor" << true;
- QTest::newRow("1.3 Gyroscope") << "1.3" << "Gyroscope" << true;
- QTest::newRow("1.3 IRProximitySensor") << "1.3" << "IRProximitySensor" << true;
- QTest::newRow("1.3 TiltSensor") << "1.3" << "TiltSensor" << true;
+ QTest::newRow("5.0 Accelerometer") << "5.0" << "Accelerometer" << true;
+ QTest::newRow("5.0 AmbientLightSensor") << "5.0" << "AmbientLightSensor" << true;
+ QTest::newRow("5.0 Compass") << "5.0" << "Compass" << true;
+ QTest::newRow("5.0 Magnetometer") << "5.0" << "Magnetometer" << true;
+ QTest::newRow("5.0 OrientationSensor") << "5.0" << "OrientationSensor" << true;
+ QTest::newRow("5.0 ProximitySensor") << "5.0" << "ProximitySensor" << true;
+ QTest::newRow("5.0 RotationSensor") << "5.0" << "RotationSensor" << true;
+ QTest::newRow("5.0 TapSensor") << "5.0" << "TapSensor" << true;
+ QTest::newRow("5.0 LightSensor") << "5.0" << "LightSensor" << true;
+ QTest::newRow("5.0 Gyroscope") << "5.0" << "Gyroscope" << true;
+ QTest::newRow("5.0 IRProximitySensor") << "5.0" << "IRProximitySensor" << true;
+ QTest::newRow("5.0 TiltSensor") << "5.0" << "TiltSensor" << true;
}
void alwaysOn()
@@ -252,7 +189,7 @@ private slots:
QFETCH(bool, validSyntax);
QQmlEngine engine;
- QString qml = QString("import QtQuick 2.0\nimport QtMobility.sensors %1\n%2 {\nalwaysOn: true\n}").arg(version).arg(element);
+ QString qml = QString("import QtQuick 2.0\nimport QtSensors %1\n%2 {\nalwaysOn: true\n}").arg(version).arg(element);
QQmlComponent c(&engine);
if (!validSyntax)
QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
@@ -325,7 +262,7 @@ private slots:
QFETCH(QVariant, expected);
QQmlEngine engine;
- QString qml = QString("import QtQuick 2.0\nimport QtMobility.sensors 1.3 as Sensors\n%1").arg(qmlcode);
+ QString qml = QString("import QtQuick 2.0\nimport QtSensors 5.0 as Sensors\n%1").arg(qmlcode);
QQmlComponent c(&engine);
c.setData(qml.toLocal8Bit(), QUrl::fromLocalFile(QDir::currentPath()));
QObject *obj = c.create();
diff --git a/tests/auto/legacy_sensors_qml/tst_qsensor.qml b/tests/auto/legacy_sensors_qml/tst_qsensor.qml
new file mode 100644
index 00000000..a7623217
--- /dev/null
+++ b/tests/auto/legacy_sensors_qml/tst_qsensor.qml
@@ -0,0 +1,204 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtTest 1.0
+import QtSensors 5.0 as Sensors
+import TestHelper 1.0
+
+TestCase {
+ id: test
+ name: "tst_qsensor"
+
+ TestHelper {
+ id: helper
+ }
+
+ Component {
+ id: cTestSensor
+ TestSensor{}
+ }
+
+ function initTestCase() {}
+
+ function cleanupTestCase() {}
+
+ function init() {}
+
+ function cleanup() {}
+
+ function sortlist(list)
+ {
+ var array = new Array();
+ for (var ii in list)
+ array.push(list[ii]);
+ array.sort();
+ return array;
+ }
+
+ function test_001_TypeRegistered()
+ {
+ var expected = [ "test sensor", "test sensor 2" ];
+ var actual = Sensors.sensorTypes();
+ // FIXME .sort() is broken!
+ actual = sortlist(actual); // The actual list is not in a defined order
+ compare(actual, expected);
+ }
+
+ function test_002_SensorRegistered()
+ {
+ var expected = [ "test sensor 2", "test sensor 3", "test sensor impl" ];
+ var actual = Sensors.sensorsForType("test sensor");
+ // FIXME .sort() is broken!
+ actual = sortlist(actual); // The actual list is not in a defined order
+ compare(actual, expected);
+ }
+
+ function test_003_SensorDefault()
+ {
+ var expected = "test sensor impl";
+ var actual = Sensors.defaultSensorForType("test sensor");
+ compare(actual, expected);
+ }
+
+ function test_004_NoSensorsForType()
+ {
+ var expected = [];
+ var actual = Sensors.sensorsForType("bogus type");
+ compare(actual, expected);
+ }
+
+ function test_005_NoDefaultForType()
+ {
+ var expected = "";
+ var actual = Sensors.defaultSensorForType("bogus type");
+ compare(actual, expected);
+ }
+
+ function test_006_Creation()
+ {
+ var sensor = cTestSensor.createObject();
+ compare(sensor.connectedToBackend, true);
+ var expected = "test sensor impl";
+ var actual = sensor.sensorid;
+ compare(actual, expected);
+ sensor.destroy();
+ }
+
+ function test_008_Timestamp()
+ {
+ var sensor = cTestSensor.createObject();
+ compare(sensor.connectedToBackend, true);
+ var timestamp = sensor.reading.timestamp;
+ compare(timestamp, 0);
+ sensor.doThis = "setOne";
+ sensor.start();
+ timestamp = sensor.reading.timestamp;
+ compare(timestamp, 1);
+ sensor.destroy();
+ }
+
+ function test_009_Start()
+ {
+ var sensor = cTestSensor.createObject();
+ sensor.start();
+ compare(sensor.active, true);
+ sensor.start();
+ compare(sensor.active, true);
+ sensor.destroy();
+ }
+
+ function test_010_Stop()
+ {
+ var sensor = cTestSensor.createObject();
+ sensor.stop();
+ compare(sensor.active, false);
+ sensor.start();
+ compare(sensor.active, true);
+ sensor.stop();
+ compare(sensor.active, false);
+ sensor.destroy();
+ }
+
+ function test_011_Start2()
+ {
+ var sensor = cTestSensor.createObject();
+
+ sensor.doThis = "stop";
+ sensor.start();
+ compare(sensor.active, false);
+ sensor.stop();
+
+ sensor.doThis = "error";
+ sensor.start();
+ compare(sensor.error, 1);
+ // Yes, this is non-intuitive but the sensor
+ // decides if an error is fatal or not.
+ // In this case our test sensor is reporting a
+ // non-fatal error so the sensor will start.
+ compare(sensor.active, true);
+ sensor.stop();
+
+ sensor.doThis = "setOne";
+ sensor.start();
+ compare(sensor.reading.timestamp, 1);
+ sensor.stop();
+
+ sensor.doThis = "setTwo";
+ sensor.start();
+ compare(sensor.reading.timestamp, 2);
+ sensor.stop();
+ sensor.destroy();
+ }
+
+ function test_012_SetBadDataRate()
+ {
+ var sensor = cTestSensor.createObject();
+
+ ignoreWarning("setDataRate: 1 is not supported by the sensor. ");
+ sensor.dataRate = 1;
+ compare(sensor.dataRate, 0);
+
+ ignoreWarning("setDataRate: 1000 is not supported by the sensor. ");
+ sensor.dataRate = 1000;
+ compare(sensor.dataRate, 0);
+ sensor.destroy();
+ }
+}
diff --git a/tests/auto/qsensor/tst_qsensor.cpp b/tests/auto/qsensor/tst_qsensor.cpp
index 5b4c40b8..a4591aa4 100644
--- a/tests/auto/qsensor/tst_qsensor.cpp
+++ b/tests/auto/qsensor/tst_qsensor.cpp
@@ -41,12 +41,12 @@
//TESTED_COMPONENT=src/sensors
-#include <QObject>
+#include <QtCore/QObject>
#include <QTest>
-#include <QDebug>
-#include <QFile>
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
#include <QSignalSpy>
-#include <QSensorManager>
+#include <QtSensors/QSensorManager>
#include "qsensor.h"
#include "test_sensor.h"
diff --git a/tests/auto/qtsensors5/tst_qtsensors5.cpp b/tests/auto/qtsensors5/tst_qtsensors5.cpp
index 719876fd..8d62f485 100644
--- a/tests/auto/qtsensors5/tst_qtsensors5.cpp
+++ b/tests/auto/qtsensors5/tst_qtsensors5.cpp
@@ -43,11 +43,11 @@
#include <QQmlEngine>
#include <QQmlComponent>
-class tst_qtsensors5 : public QObject
+class tst_QtSensors : public QObject
{
Q_OBJECT
public:
- tst_qtsensors5(QObject *parent = 0)
+ tst_QtSensors(QObject *parent = 0)
: QObject(parent)
{
}
@@ -62,6 +62,6 @@ private slots:
}
};
-QTEST_MAIN(tst_qtsensors5)
+QTEST_MAIN(tst_QtSensors)
#include "tst_qtsensors5.moc"