summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-05-21 10:01:56 +0300
committerJuha Vuolle <juha.vuolle@insta.fi>2021-05-26 09:48:04 +0300
commit0193d164e79845f7a2b5a388ed2818854c77399f (patch)
tree68d05a426a53d39c0bce34705dd91fbbbc9c24e5 /src
parentcf21f9074be72e9d5a1c45638bf6762edad7a73f (diff)
Split the Sensors QML plugin into a library and a plugin
The main changes: - Introduction of new SensorsQuick library with private exports - The original QML plugin loads this new library and does little else - Renamed original 'sensors' plugin as 'declarative_sensors' to provide an idea what it relates to - Renamed library headers as private "_p.h" and added "We mean it" - Changed qmlRegister* calls to QML_ELEMENT macros - Removed files that are generated in Qt6 (qmldir, plugins.qmltypes) Task-number: QTBUG-92530 Change-Id: I18f849adabcc79ac47e67305f78aefeee82801bc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/imports/sensors/CMakeLists.txt36
-rw-r--r--src/imports/sensors/plugin.json1
-rw-r--r--src/imports/sensors/plugins.qmltypes613
-rw-r--r--src/imports/sensors/qmldir4
-rw-r--r--src/imports/sensors/sensors.cpp202
-rw-r--r--src/sensorsquick/CMakeLists.txt45
-rw-r--r--src/sensorsquick/qmlaccelerometer.cpp (renamed from src/imports/sensors/qmlaccelerometer.cpp)2
-rw-r--r--src/sensorsquick/qmlaccelerometer_p.h (renamed from src/imports/sensors/qmlaccelerometer.h)26
-rw-r--r--src/sensorsquick/qmlaltimeter.cpp (renamed from src/imports/sensors/qmlaltimeter.cpp)2
-rw-r--r--src/sensorsquick/qmlaltimeter_p.h (renamed from src/imports/sensors/qmlaltimeter.h)26
-rw-r--r--src/sensorsquick/qmlambientlightsensor.cpp (renamed from src/imports/sensors/qmlambientlightsensor.cpp)2
-rw-r--r--src/sensorsquick/qmlambientlightsensor_p.h (renamed from src/imports/sensors/qmlambientlightsensor.h)26
-rw-r--r--src/sensorsquick/qmlambienttemperaturesensor.cpp (renamed from src/imports/sensors/qmlambienttemperaturesensor.cpp)2
-rw-r--r--src/sensorsquick/qmlambienttemperaturesensor_p.h (renamed from src/imports/sensors/qmlambienttemperaturesensor.h)26
-rw-r--r--src/sensorsquick/qmlcompass.cpp (renamed from src/imports/sensors/qmlcompass.cpp)2
-rw-r--r--src/sensorsquick/qmlcompass_p.h (renamed from src/imports/sensors/qmlcompass.h)26
-rw-r--r--src/sensorsquick/qmldistancesensor.cpp (renamed from src/imports/sensors/qmldistancesensor.cpp)2
-rw-r--r--src/sensorsquick/qmldistancesensor_p.h (renamed from src/imports/sensors/qmldistancesensor.h)26
-rw-r--r--src/sensorsquick/qmlgyroscope.cpp (renamed from src/imports/sensors/qmlgyroscope.cpp)2
-rw-r--r--src/sensorsquick/qmlgyroscope_p.h (renamed from src/imports/sensors/qmlgyroscope.h)26
-rw-r--r--src/sensorsquick/qmlholstersensor.cpp (renamed from src/imports/sensors/qmlholstersensor.cpp)2
-rw-r--r--src/sensorsquick/qmlholstersensor_p.h (renamed from src/imports/sensors/qmlholstersensor.h)26
-rw-r--r--src/sensorsquick/qmlhumiditysensor.cpp (renamed from src/imports/sensors/qmlhumiditysensor.cpp)2
-rw-r--r--src/sensorsquick/qmlhumiditysensor_p.h (renamed from src/imports/sensors/qmlhumiditysensor.h)26
-rw-r--r--src/sensorsquick/qmlirproximitysensor.cpp (renamed from src/imports/sensors/qmlirproximitysensor.cpp)2
-rw-r--r--src/sensorsquick/qmlirproximitysensor_p.h (renamed from src/imports/sensors/qmlirproximitysensor.h)26
-rw-r--r--src/sensorsquick/qmllidsensor.cpp (renamed from src/imports/sensors/qmllidsensor.cpp)2
-rw-r--r--src/sensorsquick/qmllidsensor_p.h (renamed from src/imports/sensors/qmllidsensor.h)26
-rw-r--r--src/sensorsquick/qmllightsensor.cpp (renamed from src/imports/sensors/qmllightsensor.cpp)2
-rw-r--r--src/sensorsquick/qmllightsensor_p.h (renamed from src/imports/sensors/qmllightsensor.h)26
-rw-r--r--src/sensorsquick/qmlmagnetometer.cpp (renamed from src/imports/sensors/qmlmagnetometer.cpp)2
-rw-r--r--src/sensorsquick/qmlmagnetometer_p.h (renamed from src/imports/sensors/qmlmagnetometer.h)26
-rw-r--r--src/sensorsquick/qmlorientationsensor.cpp (renamed from src/imports/sensors/qmlorientationsensor.cpp)2
-rw-r--r--src/sensorsquick/qmlorientationsensor_p.h (renamed from src/imports/sensors/qmlorientationsensor.h)26
-rw-r--r--src/sensorsquick/qmlpressuresensor.cpp (renamed from src/imports/sensors/qmlpressuresensor.cpp)2
-rw-r--r--src/sensorsquick/qmlpressuresensor_p.h (renamed from src/imports/sensors/qmlpressuresensor.h)26
-rw-r--r--src/sensorsquick/qmlproximitysensor.cpp (renamed from src/imports/sensors/qmlproximitysensor.cpp)2
-rw-r--r--src/sensorsquick/qmlproximitysensor_p.h (renamed from src/imports/sensors/qmlproximitysensor.h)26
-rw-r--r--src/sensorsquick/qmlrotationsensor.cpp (renamed from src/imports/sensors/qmlrotationsensor.cpp)2
-rw-r--r--src/sensorsquick/qmlrotationsensor_p.h (renamed from src/imports/sensors/qmlrotationsensor.h)26
-rw-r--r--src/sensorsquick/qmlsensor.cpp (renamed from src/imports/sensors/qmlsensor.cpp)2
-rw-r--r--src/sensorsquick/qmlsensor_p.h (renamed from src/imports/sensors/qmlsensor.h)30
-rw-r--r--src/sensorsquick/qmlsensorgesture.cpp (renamed from src/imports/sensors/qmlsensorgesture.cpp)2
-rw-r--r--src/sensorsquick/qmlsensorgesture_p.h (renamed from src/imports/sensors/qmlsensorgesture.h)22
-rw-r--r--src/sensorsquick/qmlsensorglobal.cpp (renamed from src/imports/sensors/qmlsensorglobal.cpp)2
-rw-r--r--src/sensorsquick/qmlsensorglobal_p.h (renamed from src/imports/sensors/qmlsensorglobal.h)22
-rw-r--r--src/sensorsquick/qmlsensorrange.cpp (renamed from src/imports/sensors/qmlsensorrange.cpp)2
-rw-r--r--src/sensorsquick/qmlsensorrange_p.h (renamed from src/imports/sensors/qmlsensorrange.h)27
-rw-r--r--src/sensorsquick/qmltapsensor.cpp (renamed from src/imports/sensors/qmltapsensor.cpp)2
-rw-r--r--src/sensorsquick/qmltapsensor_p.h (renamed from src/imports/sensors/qmltapsensor.h)26
-rw-r--r--src/sensorsquick/qmltiltsensor.cpp (renamed from src/imports/sensors/qmltiltsensor.cpp)2
-rw-r--r--src/sensorsquick/qmltiltsensor_p.h (renamed from src/imports/sensors/qmltiltsensor.h)26
-rw-r--r--src/sensorsquick/qsensorsquickglobal_p.h74
54 files changed, 642 insertions, 975 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9a363951..bb87443e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,6 @@
add_subdirectory(sensors)
add_subdirectory(plugins)
if(TARGET Qt::Quick)
+ add_subdirectory(sensorsquick)
add_subdirectory(imports)
endif()
diff --git a/src/imports/sensors/CMakeLists.txt b/src/imports/sensors/CMakeLists.txt
index 87414bde..d20add31 100644
--- a/src/imports/sensors/CMakeLists.txt
+++ b/src/imports/sensors/CMakeLists.txt
@@ -1,42 +1,14 @@
-
-# TODO Qt 6.2 split into separate QML library + plugin
-
-qt_internal_add_qml_module(sensors
+qt_internal_add_qml_module(declarative_sensors
URI "QtSensors"
- VERSION "${CMAKE_PROJECT_VERSION}"
+ VERSION "${PROJECT_VERSION}"
CLASSNAME QtSensorsDeclarativeModule
SKIP_TYPE_REGISTRATION
+ PLUGIN_OPTIONAL
SOURCES
- qmlaccelerometer.cpp qmlaccelerometer.h
- qmlaltimeter.cpp qmlaltimeter.h
- qmlambientlightsensor.cpp qmlambientlightsensor.h
- qmlambienttemperaturesensor.cpp qmlambienttemperaturesensor.h
- qmlcompass.cpp qmlcompass.h
- qmldistancesensor.cpp qmldistancesensor.h
- qmlgyroscope.cpp qmlgyroscope.h
- qmlholstersensor.cpp qmlholstersensor.h
- qmlhumiditysensor.cpp qmlhumiditysensor.h
- qmlirproximitysensor.cpp qmlirproximitysensor.h
- qmllidsensor.cpp qmllidsensor.h
- qmllightsensor.cpp qmllightsensor.h
- qmlmagnetometer.cpp qmlmagnetometer.h
- qmlorientationsensor.cpp qmlorientationsensor.h
- qmlpressuresensor.cpp qmlpressuresensor.h
- qmlproximitysensor.cpp qmlproximitysensor.h
- qmlrotationsensor.cpp qmlrotationsensor.h
- qmlsensor.cpp qmlsensor.h
- qmlsensorgesture.cpp qmlsensorgesture.h
- qmlsensorglobal.cpp qmlsensorglobal.h
- qmlsensorrange.cpp qmlsensorrange.h
- qmltapsensor.cpp qmltapsensor.h
- qmltiltsensor.cpp qmltiltsensor.h
sensors.cpp
PUBLIC_LIBRARIES
Qt::Core
- Qt::Gui
Qt::Qml
- Qt::Sensors
LIBRARIES
- Qt::CorePrivate
- Qt::SensorsPrivate
+ Qt::SensorsQuickPrivate
)
diff --git a/src/imports/sensors/plugin.json b/src/imports/sensors/plugin.json
deleted file mode 100644
index 0967ef42..00000000
--- a/src/imports/sensors/plugin.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/src/imports/sensors/plugins.qmltypes b/src/imports/sensors/plugins.qmltypes
deleted file mode 100644
index c68c37b3..00000000
--- a/src/imports/sensors/plugins.qmltypes
+++ /dev/null
@@ -1,613 +0,0 @@
-import QtQuick.tooling 1.2
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtSensors 5.15'
-
-Module {
- dependencies: ["QtQuick 2.0"]
- Component {
- name: "QmlAccelerometer"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/Accelerometer 5.0",
- "QtSensors/Accelerometer 5.1",
- "QtSensors/Accelerometer 5.2"
- ]
- exportMetaObjectRevisions: [0, 1, 1]
- Enum {
- name: "AccelerationMode"
- values: {
- "Combined": 0,
- "Gravity": 1,
- "User": 2
- }
- }
- Property { name: "accelerationMode"; revision: 1; type: "AccelerationMode" }
- Signal {
- name: "accelerationModeChanged"
- revision: 1
- Parameter { name: "accelerationMode"; type: "AccelerationMode" }
- }
- }
- Component {
- name: "QmlAccelerometerReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/AccelerometerReading 5.0",
- "QtSensors/AccelerometerReading 5.1",
- "QtSensors/AccelerometerReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "x"; type: "double"; isReadonly: true }
- Property { name: "y"; type: "double"; isReadonly: true }
- Property { name: "z"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlAltimeter"
- prototype: "QmlSensor"
- exports: ["QtSensors/Altimeter 5.1", "QtSensors/Altimeter 5.2"]
- exportMetaObjectRevisions: [0, 0]
- }
- Component {
- name: "QmlAltimeterReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/AltimeterReading 5.1",
- "QtSensors/AltimeterReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0]
- Property { name: "altitude"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlAmbientLightSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/AmbientLightSensor 5.0",
- "QtSensors/AmbientLightSensor 5.1",
- "QtSensors/AmbientLightSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- }
- Component {
- name: "QmlAmbientLightSensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/AmbientLightReading 5.0",
- "QtSensors/AmbientLightReading 5.1",
- "QtSensors/AmbientLightReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "lightLevel"; type: "QAmbientLightReading::LightLevel"; isReadonly: true }
- }
- Component {
- name: "QmlAmbientTemperatureReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/AmbientTemperatureReading 5.1",
- "QtSensors/AmbientTemperatureReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0]
- Property { name: "temperature"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlAmbientTemperatureSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/AmbientTemperatureSensor 5.1",
- "QtSensors/AmbientTemperatureSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0]
- }
- Component {
- name: "QmlCompass"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/Compass 5.0",
- "QtSensors/Compass 5.1",
- "QtSensors/Compass 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- }
- Component {
- name: "QmlCompassReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/CompassReading 5.0",
- "QtSensors/CompassReading 5.1",
- "QtSensors/CompassReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "azimuth"; type: "double"; isReadonly: true }
- Property { name: "calibrationLevel"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlDistanceReading"
- prototype: "QmlSensorReading"
- exports: ["QtSensors/DistanceReading 5.4"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "distance"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlDistanceSensor"
- prototype: "QmlSensor"
- exports: ["QtSensors/DistanceSensor 5.4"]
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QmlGyroscope"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/Gyroscope 5.0",
- "QtSensors/Gyroscope 5.1",
- "QtSensors/Gyroscope 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- }
- Component {
- name: "QmlGyroscopeReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/GyroscopeReading 5.0",
- "QtSensors/GyroscopeReading 5.1",
- "QtSensors/GyroscopeReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "x"; type: "double"; isReadonly: true }
- Property { name: "y"; type: "double"; isReadonly: true }
- Property { name: "z"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlHolsterReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/HolsterReading 5.1",
- "QtSensors/HolsterReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0]
- Property { name: "holstered"; type: "bool"; isReadonly: true }
- }
- Component {
- name: "QmlHolsterSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/HolsterSensor 5.1",
- "QtSensors/HolsterSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0]
- }
- Component {
- name: "QmlHumidityReading"
- prototype: "QmlSensorReading"
- exports: ["QtSensors/HumidityReading 5.9"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "relativeHumidity"; type: "double"; isReadonly: true }
- Property { name: "absoluteHumidity"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlHumiditySensor"
- prototype: "QmlSensor"
- exports: ["QtSensors/HumiditySensor 5.9"]
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QmlIRProximitySensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/IRProximitySensor 5.0",
- "QtSensors/IRProximitySensor 5.1",
- "QtSensors/IRProximitySensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- }
- Component {
- name: "QmlIRProximitySensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/IRProximityReading 5.0",
- "QtSensors/IRProximityReading 5.1",
- "QtSensors/IRProximityReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "reflectance"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlLidReading"
- prototype: "QmlSensorReading"
- exports: ["QtSensors/LidReading 5.9"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "backLidChanged"; type: "bool"; isReadonly: true }
- Property { name: "frontLidClosed"; type: "bool"; isReadonly: true }
- Signal {
- name: "backLidChanged"
- Parameter { name: "closed"; type: "bool" }
- }
- Signal {
- name: "frontLidChanged"
- type: "bool"
- Parameter { name: "closed"; type: "bool" }
- }
- }
- Component {
- name: "QmlLidSensor"
- prototype: "QmlSensor"
- exports: ["QtSensors/LidSensor 5.9"]
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QmlLightSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/LightSensor 5.0",
- "QtSensors/LightSensor 5.1",
- "QtSensors/LightSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "fieldOfView"; type: "double"; isReadonly: true }
- Signal {
- name: "fieldOfViewChanged"
- Parameter { name: "fieldOfView"; type: "double" }
- }
- }
- Component {
- name: "QmlLightSensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/LightReading 5.0",
- "QtSensors/LightReading 5.1",
- "QtSensors/LightReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "illuminance"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlMagnetometer"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/Magnetometer 5.0",
- "QtSensors/Magnetometer 5.1",
- "QtSensors/Magnetometer 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "returnGeoValues"; type: "bool" }
- Signal {
- name: "returnGeoValuesChanged"
- Parameter { name: "returnGeoValues"; type: "bool" }
- }
- }
- Component {
- name: "QmlMagnetometerReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/MagnetometerReading 5.0",
- "QtSensors/MagnetometerReading 5.1",
- "QtSensors/MagnetometerReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "x"; type: "double"; isReadonly: true }
- Property { name: "y"; type: "double"; isReadonly: true }
- Property { name: "z"; type: "double"; isReadonly: true }
- Property { name: "calibrationLevel"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlOrientationSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/OrientationSensor 5.0",
- "QtSensors/OrientationSensor 5.1",
- "QtSensors/OrientationSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- }
- Component {
- name: "QmlOrientationSensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/OrientationReading 5.0",
- "QtSensors/OrientationReading 5.1",
- "QtSensors/OrientationReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "orientation"; type: "QOrientationReading::Orientation"; isReadonly: true }
- }
- Component {
- name: "QmlPressureReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/PressureReading 5.1",
- "QtSensors/PressureReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 1]
- Property { name: "pressure"; type: "double"; isReadonly: true }
- Property { name: "temperature"; revision: 1; type: "double"; isReadonly: true }
- Signal { name: "temperatureChanged"; revision: 1 }
- }
- Component {
- name: "QmlPressureSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/PressureSensor 5.1",
- "QtSensors/PressureSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0]
- }
- Component {
- name: "QmlProximitySensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/ProximitySensor 5.0",
- "QtSensors/ProximitySensor 5.1",
- "QtSensors/ProximitySensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- }
- Component {
- name: "QmlProximitySensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/ProximityReading 5.0",
- "QtSensors/ProximityReading 5.1",
- "QtSensors/ProximityReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "near"; type: "bool"; isReadonly: true }
- }
- Component {
- name: "QmlRotationSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/RotationSensor 5.0",
- "QtSensors/RotationSensor 5.1",
- "QtSensors/RotationSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "hasZ"; type: "bool"; isReadonly: true }
- Signal {
- name: "hasZChanged"
- Parameter { name: "hasZ"; type: "bool" }
- }
- }
- Component {
- name: "QmlRotationSensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/RotationReading 5.0",
- "QtSensors/RotationReading 5.1",
- "QtSensors/RotationReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "x"; type: "double"; isReadonly: true }
- Property { name: "y"; type: "double"; isReadonly: true }
- Property { name: "z"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlSensor"
- prototype: "QObject"
- exports: [
- "QtSensors/Sensor 5.0",
- "QtSensors/Sensor 5.1",
- "QtSensors/Sensor 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 1, 1]
- Enum {
- name: "AxesOrientationMode"
- values: {
- "FixedOrientation": 0,
- "AutomaticOrientation": 1,
- "UserOrientation": 2
- }
- }
- Property { name: "identifier"; type: "string" }
- Property { name: "type"; type: "string"; isReadonly: true }
- Property { name: "connectedToBackend"; type: "bool"; isReadonly: true }
- Property { name: "availableDataRates"; type: "QmlSensorRange"; isList: true; isReadonly: true }
- Property { name: "dataRate"; type: "int" }
- Property { name: "reading"; type: "QmlSensorReading"; isReadonly: true; isPointer: true }
- Property { name: "busy"; type: "bool"; isReadonly: true }
- Property { name: "active"; type: "bool" }
- Property { name: "outputRanges"; type: "QmlSensorOutputRange"; isList: true; isReadonly: true }
- Property { name: "outputRange"; type: "int" }
- Property { name: "description"; type: "string"; isReadonly: true }
- Property { name: "error"; type: "int"; isReadonly: true }
- Property { name: "alwaysOn"; type: "bool" }
- Property { name: "skipDuplicates"; revision: 1; type: "bool" }
- Property { name: "axesOrientationMode"; revision: 1; type: "AxesOrientationMode" }
- Property { name: "currentOrientation"; revision: 1; type: "int"; isReadonly: true }
- Property { name: "userOrientation"; revision: 1; type: "int" }
- Property { name: "maxBufferSize"; revision: 1; type: "int"; isReadonly: true }
- Property { name: "efficientBufferSize"; revision: 1; type: "int"; isReadonly: true }
- Property { name: "bufferSize"; revision: 1; type: "int" }
- Signal {
- name: "skipDuplicatesChanged"
- revision: 1
- Parameter { name: "skipDuplicates"; type: "bool" }
- }
- Signal {
- name: "axesOrientationModeChanged"
- revision: 1
- Parameter { name: "axesOrientationMode"; type: "AxesOrientationMode" }
- }
- Signal {
- name: "currentOrientationChanged"
- revision: 1
- Parameter { name: "currentOrientation"; type: "int" }
- }
- Signal {
- name: "userOrientationChanged"
- revision: 1
- Parameter { name: "userOrientation"; type: "int" }
- }
- Signal {
- name: "maxBufferSizeChanged"
- revision: 1
- Parameter { name: "maxBufferSize"; type: "int" }
- }
- Signal {
- name: "efficientBufferSizeChanged"
- revision: 1
- Parameter { name: "efficientBufferSize"; type: "int" }
- }
- Signal {
- name: "bufferSizeChanged"
- revision: 1
- Parameter { name: "bufferSize"; type: "int" }
- }
- Method { name: "start"; type: "bool" }
- Method { name: "stop" }
- }
- Component {
- name: "QmlSensorGesture"
- prototype: "QObject"
- exports: [
- "QtSensors/SensorGesture 5.0",
- "QtSensors/SensorGesture 5.1",
- "QtSensors/SensorGesture 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "availableGestures"; type: "QStringList"; isReadonly: true }
- Property { name: "gestures"; type: "QStringList" }
- Property { name: "validGestures"; type: "QStringList"; isReadonly: true }
- Property { name: "invalidGestures"; type: "QStringList"; isReadonly: true }
- Property { name: "enabled"; type: "bool" }
- Signal {
- name: "detected"
- Parameter { name: "gesture"; type: "string" }
- }
- }
- Component {
- name: "QmlSensorGlobal"
- prototype: "QObject"
- exports: [
- "QtSensors/QmlSensors 5.0",
- "QtSensors/QmlSensors 5.1",
- "QtSensors/QmlSensors 5.2"
- ]
- isCreatable: false
- isSingleton: true
- exportMetaObjectRevisions: [0, 0, 0]
- Signal { name: "availableSensorsChanged" }
- Method { name: "sensorTypes"; type: "QStringList" }
- Method {
- name: "sensorsForType"
- type: "QStringList"
- Parameter { name: "type"; type: "string" }
- }
- Method {
- name: "defaultSensorForType"
- type: "string"
- Parameter { name: "type"; type: "string" }
- }
- }
- Component {
- name: "QmlSensorOutputRange"
- prototype: "QObject"
- exports: [
- "QtSensors/OutputRange 5.0",
- "QtSensors/OutputRange 5.1",
- "QtSensors/OutputRange 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "minimum"; type: "double"; isReadonly: true }
- Property { name: "maximum"; type: "double"; isReadonly: true }
- Property { name: "accuracy"; type: "double"; isReadonly: true }
- }
- Component {
- name: "QmlSensorRange"
- prototype: "QObject"
- exports: [
- "QtSensors/Range 5.0",
- "QtSensors/Range 5.1",
- "QtSensors/Range 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "minimum"; type: "int"; isReadonly: true }
- Property { name: "maximum"; type: "int"; isReadonly: true }
- }
- Component {
- name: "QmlSensorReading"
- prototype: "QObject"
- exports: [
- "QtSensors/SensorReading 5.0",
- "QtSensors/SensorReading 5.1",
- "QtSensors/SensorReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "timestamp"; type: "qulonglong"; isReadonly: true }
- }
- Component {
- name: "QmlTapSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/TapSensor 5.0",
- "QtSensors/TapSensor 5.1",
- "QtSensors/TapSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "returnDoubleTapEvents"; type: "bool" }
- Signal {
- name: "returnDoubleTapEventsChanged"
- Parameter { name: "returnDoubleTapEvents"; type: "bool" }
- }
- }
- Component {
- name: "QmlTapSensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/TapReading 5.0",
- "QtSensors/TapReading 5.1",
- "QtSensors/TapReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "tapDirection"; type: "QTapReading::TapDirection"; isReadonly: true }
- Property { name: "doubleTap"; type: "bool"; isReadonly: true }
- Signal { name: "isDoubleTapChanged" }
- }
- Component {
- name: "QmlTiltSensor"
- prototype: "QmlSensor"
- exports: [
- "QtSensors/TiltSensor 5.0",
- "QtSensors/TiltSensor 5.1",
- "QtSensors/TiltSensor 5.2"
- ]
- exportMetaObjectRevisions: [0, 0, 0]
- Method { name: "calibrate" }
- }
- Component {
- name: "QmlTiltSensorReading"
- prototype: "QmlSensorReading"
- exports: [
- "QtSensors/TiltReading 5.0",
- "QtSensors/TiltReading 5.1",
- "QtSensors/TiltReading 5.2"
- ]
- isCreatable: false
- exportMetaObjectRevisions: [0, 0, 0]
- Property { name: "yRotation"; type: "double"; isReadonly: true }
- Property { name: "xRotation"; type: "double"; isReadonly: true }
- }
-}
diff --git a/src/imports/sensors/qmldir b/src/imports/sensors/qmldir
deleted file mode 100644
index 8ce4a5aa..00000000
--- a/src/imports/sensors/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtSensors
-plugin declarative_sensors
-classname QtSensorsDeclarativeModule
-typeinfo plugins.qmltypes
diff --git a/src/imports/sensors/sensors.cpp b/src/imports/sensors/sensors.cpp
index de872c48..3244707b 100644
--- a/src/imports/sensors/sensors.cpp
+++ b/src/imports/sensors/sensors.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtSensors module of the Qt Toolkit.
@@ -37,206 +37,24 @@
**
****************************************************************************/
+#include <QtSensorsQuick/private/qsensorsquickglobal_p.h>
#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/qqml.h>
-#include <QtSensors/QSensorManager>
-
-#include <QtSensors/qaccelerometer.h>
-#include <QtSensors/qaltimeter.h>
-#include <QtSensors/qambientlightsensor.h>
-#include <QtSensors/qambienttemperaturesensor.h>
-#include <QtSensors/qcompass.h>
-#include <QtSensors/qdistancesensor.h>
-#include <QtSensors/qhumiditysensor.h>
-#include <QtSensors/qmagnetometer.h>
-#include <QtSensors/qorientationsensor.h>
-#include <QtSensors/qproximitysensor.h>
-#include <QtSensors/qrotationsensor.h>
-#include <QtSensors/qtapsensor.h>
-#include <QtSensors/qlightsensor.h>
-#include <QtSensors/qgyroscope.h>
-#include <QtSensors/qirproximitysensor.h>
-#include <QtSensors/qtiltsensor.h>
-#include <QtSensors/qlidsensor.h>
-
-#include "qmlsensorglobal.h"
-#include "qmlsensor.h"
-#include "qmlaccelerometer.h"
-#include "qmlaltimeter.h"
-#include "qmlambientlightsensor.h"
-#include "qmlambienttemperaturesensor.h"
-#include "qmlcompass.h"
-#include "qmldistancesensor.h"
-#include "qmlgyroscope.h"
-#include "qmlholstersensor.h"
-#include "qmlhumiditysensor.h"
-#include "qmlirproximitysensor.h"
-#include "qmllightsensor.h"
-#include "qmlmagnetometer.h"
-#include "qmlorientationsensor.h"
-#include "qmlpressuresensor.h"
-#include "qmlproximitysensor.h"
-#include "qmlrotationsensor.h"
-#include "qmltapsensor.h"
-#include "qmltiltsensor.h"
-#include "qmlsensorgesture.h"
-#include "qmllidsensor.h"
QT_BEGIN_NAMESPACE
-static QObject *global_object_50(QQmlEngine *, QJSEngine *)
-{
- return new QmlSensorGlobal;
-}
-
-class QtSensorsDeclarativeModule : public QQmlExtensionPlugin
+class QSensorsQuickPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid FILE "plugin.json")
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+
public:
- QtSensorsDeclarativeModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { }
- void registerTypes(const char *uri) override
+ QSensorsQuickPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { }
+ void registerTypes(const char *) override
{
- char const * const package = "QtSensors";
- if (QLatin1String(uri) != QLatin1String(package)) return;
- int major;
- int minor;
-
- // 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"));
- qmlRegisterUncreatableType<QmlSensorReading >(package, major, minor, "SensorReading", QLatin1String("Cannot create SensorReading"));
- qmlRegisterType <QmlAccelerometer >(package, major, minor, "Accelerometer");
- qmlRegisterUncreatableType<QmlAccelerometerReading >(package, major, minor, "AccelerometerReading", QLatin1String("Cannot create AccelerometerReading"));
- qmlRegisterType <QmlAmbientLightSensor >(package, major, minor, "AmbientLightSensor");
- qmlRegisterUncreatableType<QmlAmbientLightSensorReading>(package, major, minor, "AmbientLightReading", QLatin1String("Cannot create AmbientLightReading"));
- qmlRegisterType <QmlCompass >(package, major, minor, "Compass");
- qmlRegisterUncreatableType<QmlCompassReading >(package, major, minor, "CompassReading", QLatin1String("Cannot create CompassReading"));
- qmlRegisterType <QmlGyroscope >(package, major, minor, "Gyroscope");
- qmlRegisterUncreatableType<QmlGyroscopeReading >(package, major, minor, "GyroscopeReading", QLatin1String("Cannot create GyroscopeReading"));
- qmlRegisterType <QmlIRProximitySensor >(package, major, minor, "IRProximitySensor");
- qmlRegisterUncreatableType<QmlIRProximitySensorReading >(package, major, minor, "IRProximityReading", QLatin1String("Cannot create IRProximityReading"));
- qmlRegisterType <QmlLightSensor >(package, major, minor, "LightSensor");
- qmlRegisterUncreatableType<QmlLightSensorReading >(package, major, minor, "LightReading", QLatin1String("Cannot create LightReading"));
- qmlRegisterType <QmlMagnetometer >(package, major, minor, "Magnetometer");
- qmlRegisterUncreatableType<QmlMagnetometerReading >(package, major, minor, "MagnetometerReading", QLatin1String("Cannot create MagnetometerReading"));
- qmlRegisterType <QmlOrientationSensor >(package, major, minor, "OrientationSensor");
- qmlRegisterUncreatableType<QmlOrientationSensorReading >(package, major, minor, "OrientationReading", QLatin1String("Cannot create OrientationReading"));
- qmlRegisterType <QmlProximitySensor >(package, major, minor, "ProximitySensor");
- qmlRegisterUncreatableType<QmlProximitySensorReading >(package, major, minor, "ProximityReading", QLatin1String("Cannot create ProximityReading"));
- qmlRegisterType <QmlRotationSensor >(package, major, minor, "RotationSensor");
- qmlRegisterUncreatableType<QmlRotationSensorReading >(package, major, minor, "RotationReading", QLatin1String("Cannot create RotationReading"));
- qmlRegisterType <QmlTapSensor >(package, major, minor, "TapSensor");
- qmlRegisterUncreatableType<QmlTapSensorReading >(package, major, minor, "TapReading", QLatin1String("Cannot create TapReading"));
- qmlRegisterType <QmlTiltSensor >(package, major, minor, "TiltSensor");
- qmlRegisterUncreatableType<QmlTiltSensorReading >(package, major, minor, "TiltReading", QLatin1String("Cannot create TiltReading"));
-
- qmlRegisterType <QmlSensorGesture >(package, major, minor, "SensorGesture");
-
- // Register the 5.1 interfaces
- minor = 1;
- 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,1 >(package, major, minor, "Sensor", QLatin1String("Cannot create Sensor"));
- qmlRegisterUncreatableType<QmlSensorReading >(package, major, minor, "SensorReading", QLatin1String("Cannot create SensorReading"));
- qmlRegisterType <QmlAccelerometer,1 >(package, major, minor, "Accelerometer");
- qmlRegisterUncreatableType<QmlAccelerometerReading >(package, major, minor, "AccelerometerReading", QLatin1String("Cannot create AccelerometerReading"));
- qmlRegisterType <QmlAltimeter >(package, major, minor, "Altimeter");
- qmlRegisterUncreatableType<QmlAltimeterReading >(package, major, minor, "AltimeterReading", QLatin1String("Cannot create AltimeterReading"));
- qmlRegisterType <QmlAmbientLightSensor >(package, major, minor, "AmbientLightSensor");
- qmlRegisterUncreatableType<QmlAmbientLightSensorReading>(package, major, minor, "AmbientLightReading", QLatin1String("Cannot create AmbientLightReading"));
- qmlRegisterType <QmlAmbientTemperatureSensor >(package, major, minor, "AmbientTemperatureSensor");
- qmlRegisterUncreatableType<QmlAmbientTemperatureReading>(package, major, minor, "AmbientTemperatureReading", QLatin1String("Cannot create AmbientTemperatureReading"));
- qmlRegisterType <QmlCompass >(package, major, minor, "Compass");
- qmlRegisterUncreatableType<QmlCompassReading >(package, major, minor, "CompassReading", QLatin1String("Cannot create CompassReading"));
- qmlRegisterType <QmlGyroscope >(package, major, minor, "Gyroscope");
- qmlRegisterUncreatableType<QmlGyroscopeReading >(package, major, minor, "GyroscopeReading", QLatin1String("Cannot create GyroscopeReading"));
- qmlRegisterType <QmlHolsterSensor >(package, major, minor, "HolsterSensor");
- qmlRegisterUncreatableType<QmlHolsterReading >(package, major, minor, "HolsterReading", QLatin1String("Cannot create HolsterReading"));
- qmlRegisterType <QmlIRProximitySensor >(package, major, minor, "IRProximitySensor");
- qmlRegisterUncreatableType<QmlIRProximitySensorReading >(package, major, minor, "IRProximityReading", QLatin1String("Cannot create IRProximityReading"));
- qmlRegisterType <QmlLightSensor >(package, major, minor, "LightSensor");
- qmlRegisterUncreatableType<QmlLightSensorReading >(package, major, minor, "LightReading", QLatin1String("Cannot create LightReading"));
- qmlRegisterType <QmlMagnetometer >(package, major, minor, "Magnetometer");
- qmlRegisterUncreatableType<QmlMagnetometerReading >(package, major, minor, "MagnetometerReading", QLatin1String("Cannot create MagnetometerReading"));
- qmlRegisterType <QmlOrientationSensor >(package, major, minor, "OrientationSensor");
- qmlRegisterUncreatableType<QmlOrientationSensorReading >(package, major, minor, "OrientationReading", QLatin1String("Cannot create OrientationReading"));
- qmlRegisterType <QmlPressureSensor >(package, major, minor, "PressureSensor");
- qmlRegisterUncreatableType<QmlPressureReading >(package, major, minor, "PressureReading", QLatin1String("Cannot create PressureReading"));
- qmlRegisterType <QmlProximitySensor >(package, major, minor, "ProximitySensor");
- qmlRegisterUncreatableType<QmlProximitySensorReading >(package, major, minor, "ProximityReading", QLatin1String("Cannot create ProximityReading"));
- qmlRegisterType <QmlRotationSensor >(package, major, minor, "RotationSensor");
- qmlRegisterUncreatableType<QmlRotationSensorReading >(package, major, minor, "RotationReading", QLatin1String("Cannot create RotationReading"));
- qmlRegisterType <QmlTapSensor >(package, major, minor, "TapSensor");
- qmlRegisterUncreatableType<QmlTapSensorReading >(package, major, minor, "TapReading", QLatin1String("Cannot create TapReading"));
- qmlRegisterType <QmlTiltSensor >(package, major, minor, "TiltSensor");
- qmlRegisterUncreatableType<QmlTiltSensorReading >(package, major, minor, "TiltReading", QLatin1String("Cannot create TiltReading"));
-
- qmlRegisterType <QmlSensorGesture >(package, major, minor, "SensorGesture");
-
- // Register the 5.2 interfaces
- minor = 2;
- 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,1 >(package, major, minor, "Sensor", QLatin1String("Cannot create Sensor"));
- qmlRegisterUncreatableType<QmlSensorReading >(package, major, minor, "SensorReading", QLatin1String("Cannot create SensorReading"));
- qmlRegisterType <QmlAccelerometer,1 >(package, major, minor, "Accelerometer");
- qmlRegisterUncreatableType<QmlAccelerometerReading >(package, major, minor, "AccelerometerReading", QLatin1String("Cannot create AccelerometerReading"));
- qmlRegisterType <QmlAltimeter >(package, major, minor, "Altimeter");
- qmlRegisterUncreatableType<QmlAltimeterReading >(package, major, minor, "AltimeterReading", QLatin1String("Cannot create AltimeterReading"));
- qmlRegisterType <QmlAmbientLightSensor >(package, major, minor, "AmbientLightSensor");
- qmlRegisterUncreatableType<QmlAmbientLightSensorReading>(package, major, minor, "AmbientLightReading", QLatin1String("Cannot create AmbientLightReading"));
- qmlRegisterType <QmlAmbientTemperatureSensor >(package, major, minor, "AmbientTemperatureSensor");
- qmlRegisterUncreatableType<QmlAmbientTemperatureReading>(package, major, minor, "AmbientTemperatureReading", QLatin1String("Cannot create AmbientTemperatureReading"));
- qmlRegisterType <QmlCompass >(package, major, minor, "Compass");
- qmlRegisterUncreatableType<QmlCompassReading >(package, major, minor, "CompassReading", QLatin1String("Cannot create CompassReading"));
- qmlRegisterType <QmlGyroscope >(package, major, minor, "Gyroscope");
- qmlRegisterUncreatableType<QmlGyroscopeReading >(package, major, minor, "GyroscopeReading", QLatin1String("Cannot create GyroscopeReading"));
- qmlRegisterType <QmlHolsterSensor >(package, major, minor, "HolsterSensor");
- qmlRegisterUncreatableType<QmlHolsterReading >(package, major, minor, "HolsterReading", QLatin1String("Cannot create HolsterReading"));
- qmlRegisterType <QmlIRProximitySensor >(package, major, minor, "IRProximitySensor");
- qmlRegisterUncreatableType<QmlIRProximitySensorReading >(package, major, minor, "IRProximityReading", QLatin1String("Cannot create IRProximityReading"));
- qmlRegisterType <QmlLightSensor >(package, major, minor, "LightSensor");
- qmlRegisterUncreatableType<QmlLightSensorReading >(package, major, minor, "LightReading", QLatin1String("Cannot create LightReading"));
- qmlRegisterType <QmlMagnetometer >(package, major, minor, "Magnetometer");
- qmlRegisterUncreatableType<QmlMagnetometerReading >(package, major, minor, "MagnetometerReading", QLatin1String("Cannot create MagnetometerReading"));
- qmlRegisterType <QmlOrientationSensor >(package, major, minor, "OrientationSensor");
- qmlRegisterUncreatableType<QmlOrientationSensorReading >(package, major, minor, "OrientationReading", QLatin1String("Cannot create OrientationReading"));
- qmlRegisterType <QmlPressureSensor >(package, major, minor, "PressureSensor");
- qmlRegisterUncreatableType<QmlPressureReading,1 >(package, major, minor, "PressureReading", QLatin1String("Cannot create PressureReading"));
- qmlRegisterType <QmlProximitySensor >(package, major, minor, "ProximitySensor");
- qmlRegisterUncreatableType<QmlProximitySensorReading >(package, major, minor, "ProximityReading", QLatin1String("Cannot create ProximityReading"));
- qmlRegisterType <QmlRotationSensor >(package, major, minor, "RotationSensor");
- qmlRegisterUncreatableType<QmlRotationSensorReading >(package, major, minor, "RotationReading", QLatin1String("Cannot create RotationReading"));
- qmlRegisterType <QmlTapSensor >(package, major, minor, "TapSensor");
- qmlRegisterUncreatableType<QmlTapSensorReading >(package, major, minor, "TapReading", QLatin1String("Cannot create TapReading"));
- qmlRegisterType <QmlTiltSensor >(package, major, minor, "TiltSensor");
- qmlRegisterUncreatableType<QmlTiltSensorReading >(package, major, minor, "TiltReading", QLatin1String("Cannot create TiltReading"));
-
- qmlRegisterType <QmlSensorGesture >(package, major, minor, "SensorGesture");
-
- // Register the 5.4 interfaces
- minor = 4;
- qmlRegisterType <QmlDistanceSensor >(package, major, minor, "DistanceSensor");
- qmlRegisterUncreatableType<QmlDistanceReading >(package, major, minor, "DistanceReading", QLatin1String("Cannot create DistanceReading"));
-
- // Register the new 5.9 interfaces
- // Implicitly registers 5.3 - 5.8 too
- minor = 9;
- qmlRegisterType <QmlLidSensor >(package, major, minor, "LidSensor");
- qmlRegisterUncreatableType<QmlLidReading >(package, major, minor, "LidReading", QLatin1String("Cannot create LidReading"));
- qmlRegisterType <QmlHumiditySensor >(package, major, minor, "HumiditySensor");
- qmlRegisterUncreatableType<QmlHumidityReading >(package, major, minor, "HumidityReading", QLatin1String("Cannot create HumidityReading"));
-
- // The minor version used to be the current Qt 5 minor. For compatibility it is the last
- // Qt 5 release.
- qmlRegisterModule(package, 5, 15);
+ // Build-time generated registration function
+ volatile auto registration = &qml_register_types_QtSensors;
+ Q_UNUSED(registration);
}
};
diff --git a/src/sensorsquick/CMakeLists.txt b/src/sensorsquick/CMakeLists.txt
new file mode 100644
index 00000000..703974e1
--- /dev/null
+++ b/src/sensorsquick/CMakeLists.txt
@@ -0,0 +1,45 @@
+qt_internal_add_module(SensorsQuick
+ SOURCES
+ qmlaccelerometer.cpp qmlaccelerometer_p.h
+ qmlaltimeter.cpp qmlaltimeter_p.h
+ qmlambientlightsensor.cpp qmlambientlightsensor_p.h
+ qmlambienttemperaturesensor.cpp qmlambienttemperaturesensor_p.h
+ qmlcompass.cpp qmlcompass_p.h
+ qmldistancesensor.cpp qmldistancesensor_p.h
+ qmlgyroscope.cpp qmlgyroscope_p.h
+ qmlholstersensor.cpp qmlholstersensor_p.h
+ qmlhumiditysensor.cpp qmlhumiditysensor_p.h
+ qmlirproximitysensor.cpp qmlirproximitysensor_p.h
+ qmllidsensor.cpp qmllidsensor_p.h
+ qmllightsensor.cpp qmllightsensor_p.h
+ qmlmagnetometer.cpp qmlmagnetometer_p.h
+ qmlorientationsensor.cpp qmlorientationsensor_p.h
+ qmlpressuresensor.cpp qmlpressuresensor_p.h
+ qmlproximitysensor.cpp qmlproximitysensor_p.h
+ qmlrotationsensor.cpp qmlrotationsensor_p.h
+ qmlsensor.cpp qmlsensor_p.h
+ qmlsensorgesture.cpp qmlsensorgesture_p.h
+ qmlsensorglobal.cpp qmlsensorglobal_p.h
+ qmlsensorrange.cpp qmlsensorrange_p.h
+ qmltapsensor.cpp qmltapsensor_p.h
+ qmltiltsensor.cpp qmltiltsensor_p.h
+ qsensorsquickglobal_p.h
+ DEFINES
+ QT_BUILD_SENSORSQUICK_LIB
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Qml
+ Qt::Sensors
+ LIBRARIES
+ Qt::CorePrivate
+)
+
+set_target_properties(SensorsQuick PROPERTIES
+ QT_QML_MODULE_INSTALL_QMLTYPES TRUE
+ QT_QML_MODULE_VERSION ${PROJECT_VERSION}
+ QT_QML_MODULE_URI QtSensors
+ QT_QMLTYPES_FILENAME plugins.qmltypes
+ QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtSensors"
+)
+
+qt6_qml_type_registration(SensorsQuick)
diff --git a/src/imports/sensors/qmlaccelerometer.cpp b/src/sensorsquick/qmlaccelerometer.cpp
index 8d78fbfc..fc013837 100644
--- a/src/imports/sensors/qmlaccelerometer.cpp
+++ b/src/sensorsquick/qmlaccelerometer.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlaccelerometer.h"
+#include "qmlaccelerometer_p.h"
#include <QtSensors/QAccelerometer>
/*!
diff --git a/src/imports/sensors/qmlaccelerometer.h b/src/sensorsquick/qmlaccelerometer_p.h
index e04b9712..9dcb2692 100644
--- a/src/imports/sensors/qmlaccelerometer.h
+++ b/src/sensorsquick/qmlaccelerometer_p.h
@@ -37,21 +37,34 @@
**
****************************************************************************/
-#ifndef QMLACCELEROMETER_H
-#define QMLACCELEROMETER_H
+#ifndef QMLACCELEROMETER_P_H
+#define QMLACCELEROMETER_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QAccelerometer;
-class QmlAccelerometer : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAccelerometer : public QmlSensor
{
Q_OBJECT
Q_ENUMS(AccelerationMode)
Q_PROPERTY(AccelerationMode accelerationMode READ accelerationMode WRITE setAccelerationMode
NOTIFY accelerationModeChanged REVISION 1)
+ QML_NAMED_ELEMENT(Accelerometer)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlAccelerometer(QObject *parent = 0);
~QmlAccelerometer();
@@ -75,12 +88,15 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlAccelerometerReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAccelerometerReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal x READ x NOTIFY xChanged)
Q_PROPERTY(qreal y READ y NOTIFY yChanged)
Q_PROPERTY(qreal z READ z NOTIFY zChanged)
+ QML_NAMED_ELEMENT(AccelerometerReading)
+ QML_UNCREATABLE("Cannot create AccelerometerReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlAccelerometerReading(QAccelerometer *sensor);
~QmlAccelerometerReading();
diff --git a/src/imports/sensors/qmlaltimeter.cpp b/src/sensorsquick/qmlaltimeter.cpp
index 63c979d3..8ee3ccde 100644
--- a/src/imports/sensors/qmlaltimeter.cpp
+++ b/src/sensorsquick/qmlaltimeter.cpp
@@ -36,7 +36,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmlaltimeter.h"
+#include "qmlaltimeter_p.h"
#include <QtSensors/QAltimeter>
/*!
diff --git a/src/imports/sensors/qmlaltimeter.h b/src/sensorsquick/qmlaltimeter_p.h
index 04938b53..322fbdfb 100644
--- a/src/imports/sensors/qmlaltimeter.h
+++ b/src/sensorsquick/qmlaltimeter_p.h
@@ -36,18 +36,31 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QMLALTIMETER_H
-#define QMLALTIMETER_H
+#ifndef QMLALTIMETER_P_H
+#define QMLALTIMETER_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QAltimeter;
-class QmlAltimeter : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAltimeter : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(Altimeter)
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlAltimeter(QObject *parent = 0);
~QmlAltimeter();
@@ -59,10 +72,13 @@ private:
QAltimeter *m_sensor;
};
-class QmlAltimeterReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAltimeterReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal altitude READ altitude NOTIFY altitudeChanged)
+ QML_NAMED_ELEMENT(AltimeterReading)
+ QML_UNCREATABLE("Cannot create AltimeterReading")
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlAltimeterReading(QAltimeter *sensor);
~QmlAltimeterReading();
diff --git a/src/imports/sensors/qmlambientlightsensor.cpp b/src/sensorsquick/qmlambientlightsensor.cpp
index 5d9ab3b6..a114f8b3 100644
--- a/src/imports/sensors/qmlambientlightsensor.cpp
+++ b/src/sensorsquick/qmlambientlightsensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlambientlightsensor.h"
+#include "qmlambientlightsensor_p.h"
#include <QtSensors/QAmbientLightSensor>
/*!
diff --git a/src/imports/sensors/qmlambientlightsensor.h b/src/sensorsquick/qmlambientlightsensor_p.h
index 4de42f31..356a1128 100644
--- a/src/imports/sensors/qmlambientlightsensor.h
+++ b/src/sensorsquick/qmlambientlightsensor_p.h
@@ -37,19 +37,32 @@
**
****************************************************************************/
-#ifndef QMLAMBIENTLIGHTSENSOR_H
-#define QMLAMBIENTLIGHTSENSOR_H
+#ifndef QMLAMBIENTLIGHTSENSOR_P_H
+#define QMLAMBIENTLIGHTSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
#include <QtSensors/QAmbientLightSensor>
QT_BEGIN_NAMESPACE
class QAmbientLightSensor;
-class QmlAmbientLightSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAmbientLightSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(AmbientLightSensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlAmbientLightSensor(QObject *parent = 0);
~QmlAmbientLightSensor();
@@ -61,10 +74,13 @@ private:
};
-class QmlAmbientLightSensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAmbientLightSensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(QAmbientLightReading::LightLevel lightLevel READ lightLevel NOTIFY lightLevelChanged)
+ QML_NAMED_ELEMENT(AmbientLightReading)
+ QML_UNCREATABLE("Cannot create AmbientLightReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlAmbientLightSensorReading(QAmbientLightSensor *sensor);
diff --git a/src/imports/sensors/qmlambienttemperaturesensor.cpp b/src/sensorsquick/qmlambienttemperaturesensor.cpp
index 1958f6d8..3f1a4679 100644
--- a/src/imports/sensors/qmlambienttemperaturesensor.cpp
+++ b/src/sensorsquick/qmlambienttemperaturesensor.cpp
@@ -36,7 +36,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmlambienttemperaturesensor.h"
+#include "qmlambienttemperaturesensor_p.h"
#include <QtSensors/QAmbientTemperatureSensor>
/*!
diff --git a/src/imports/sensors/qmlambienttemperaturesensor.h b/src/sensorsquick/qmlambienttemperaturesensor_p.h
index 31ec72fa..45183ee7 100644
--- a/src/imports/sensors/qmlambienttemperaturesensor.h
+++ b/src/sensorsquick/qmlambienttemperaturesensor_p.h
@@ -36,18 +36,31 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QMLAMBIENTTEMPERATURESENSOR_H
-#define QMLAMBIENTTEMPERATURESENSOR_H
+#ifndef QMLAMBIENTTEMPERATURESENSOR_P_H
+#define QMLAMBIENTTEMPERATURESENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QAmbientTemperatureSensor;
-class QmlAmbientTemperatureSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAmbientTemperatureSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(AmbientTemperatureSensor)
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlAmbientTemperatureSensor(QObject *parent = 0);
~QmlAmbientTemperatureSensor();
@@ -59,10 +72,13 @@ private:
QAmbientTemperatureSensor *m_sensor;
};
-class QmlAmbientTemperatureReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlAmbientTemperatureReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal temperature READ temperature NOTIFY temperatureChanged)
+ QML_NAMED_ELEMENT(AmbientTemperatureReading)
+ QML_UNCREATABLE("Cannot create AmbientTemperatureReading")
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlAmbientTemperatureReading(QAmbientTemperatureSensor *sensor);
~QmlAmbientTemperatureReading();
diff --git a/src/imports/sensors/qmlcompass.cpp b/src/sensorsquick/qmlcompass.cpp
index 38fc388e..b3620d6c 100644
--- a/src/imports/sensors/qmlcompass.cpp
+++ b/src/sensorsquick/qmlcompass.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlcompass.h"
+#include "qmlcompass_p.h"
#include <QtSensors/QCompass>
/*!
diff --git a/src/imports/sensors/qmlcompass.h b/src/sensorsquick/qmlcompass_p.h
index ef4fd22f..42c1b15c 100644
--- a/src/imports/sensors/qmlcompass.h
+++ b/src/sensorsquick/qmlcompass_p.h
@@ -37,18 +37,31 @@
**
****************************************************************************/
-#ifndef QMLCOMPASS_H
-#define QMLCOMPASS_H
+#ifndef QMLCOMPASS_P_H
+#define QMLCOMPASS_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QCompass;
-class QmlCompass : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlCompass : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(Compass)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlCompass(QObject *parent = 0);
~QmlCompass();
@@ -60,11 +73,14 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlCompassReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlCompassReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal azimuth READ azimuth NOTIFY azimuthChanged)
Q_PROPERTY(qreal calibrationLevel READ calibrationLevel NOTIFY calibrationLevelChanged)
+ QML_NAMED_ELEMENT(CompassReading)
+ QML_UNCREATABLE("Cannot create CompassReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlCompassReading(QCompass *sensor);
~QmlCompassReading();
diff --git a/src/imports/sensors/qmldistancesensor.cpp b/src/sensorsquick/qmldistancesensor.cpp
index f715ae0d..b1d9f6bb 100644
--- a/src/imports/sensors/qmldistancesensor.cpp
+++ b/src/sensorsquick/qmldistancesensor.cpp
@@ -36,7 +36,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmldistancesensor.h"
+#include "qmldistancesensor_p.h"
#include <QDistanceSensor>
/*!
diff --git a/src/imports/sensors/qmldistancesensor.h b/src/sensorsquick/qmldistancesensor_p.h
index e60e0e7e..1f9d9425 100644
--- a/src/imports/sensors/qmldistancesensor.h
+++ b/src/sensorsquick/qmldistancesensor_p.h
@@ -37,18 +37,31 @@
**
****************************************************************************/
-#ifndef QMLDISTANCESENSOR_H
-#define QMLDISTANCESENSOR_H
+#ifndef QMLDISTANCESENSOR_P_H
+#define QMLDISTANCESENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QDistanceSensor;
-class QmlDistanceSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlDistanceSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(DistanceSensor)
+ QML_ADDED_IN_VERSION(5,4)
public:
explicit QmlDistanceSensor(QObject *parent = 0);
~QmlDistanceSensor();
@@ -60,10 +73,13 @@ private:
QDistanceSensor *m_sensor;
};
-class QmlDistanceReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlDistanceReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal distance READ distance NOTIFY distanceChanged)
+ QML_NAMED_ELEMENT(DistanceReading)
+ QML_UNCREATABLE("Cannot create DistanceReading")
+ QML_ADDED_IN_VERSION(5,4)
public:
explicit QmlDistanceReading(QDistanceSensor *sensor);
~QmlDistanceReading();
diff --git a/src/imports/sensors/qmlgyroscope.cpp b/src/sensorsquick/qmlgyroscope.cpp
index 3f61b8d7..9983564a 100644
--- a/src/imports/sensors/qmlgyroscope.cpp
+++ b/src/sensorsquick/qmlgyroscope.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlgyroscope.h"
+#include "qmlgyroscope_p.h"
#include <QtSensors/QGyroscope>
/*!
diff --git a/src/imports/sensors/qmlgyroscope.h b/src/sensorsquick/qmlgyroscope_p.h
index 010e4f04..549a67e4 100644
--- a/src/imports/sensors/qmlgyroscope.h
+++ b/src/sensorsquick/qmlgyroscope_p.h
@@ -37,18 +37,31 @@
**
****************************************************************************/
-#ifndef QMLGYROSCOPE_H
-#define QMLGYROSCOPE_H
+#ifndef QMLGYROSCOPE_P_H
+#define QMLGYROSCOPE_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QGyroscope;
-class QmlGyroscope : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlGyroscope : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(Gyroscope)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlGyroscope(QObject *parent = 0);
~QmlGyroscope();
@@ -60,12 +73,15 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlGyroscopeReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlGyroscopeReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal x READ x NOTIFY xChanged)
Q_PROPERTY(qreal y READ y NOTIFY yChanged)
Q_PROPERTY(qreal z READ z NOTIFY zChanged)
+ QML_NAMED_ELEMENT(GyroscopeReading)
+ QML_UNCREATABLE("Cannot create GyroscopeReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlGyroscopeReading(QGyroscope *sensor);
~QmlGyroscopeReading();
diff --git a/src/imports/sensors/qmlholstersensor.cpp b/src/sensorsquick/qmlholstersensor.cpp
index 704e2e97..cdefd683 100644
--- a/src/imports/sensors/qmlholstersensor.cpp
+++ b/src/sensorsquick/qmlholstersensor.cpp
@@ -36,7 +36,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmlholstersensor.h"
+#include "qmlholstersensor_p.h"
#include <QtSensors/QHolsterSensor>
/*!
diff --git a/src/imports/sensors/qmlholstersensor.h b/src/sensorsquick/qmlholstersensor_p.h
index 630d1d85..a64e2d12 100644
--- a/src/imports/sensors/qmlholstersensor.h
+++ b/src/sensorsquick/qmlholstersensor_p.h
@@ -36,18 +36,31 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QMLHOLSTERSENSOR_H
-#define QMLHOLSTERSENSOR_H
+#ifndef QMLHOLSTERSENSOR_P_H
+#define QMLHOLSTERSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QHolsterSensor;
-class QmlHolsterSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlHolsterSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(HolsterSensor)
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlHolsterSensor(QObject *parent = 0);
~QmlHolsterSensor();
@@ -59,10 +72,13 @@ private:
QHolsterSensor *m_sensor;
};
-class QmlHolsterReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlHolsterReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(bool holstered READ holstered NOTIFY holsteredChanged)
+ QML_NAMED_ELEMENT(HolsterReading)
+ QML_UNCREATABLE("Cannot create HolsterReading")
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlHolsterReading(QHolsterSensor *sensor);
~QmlHolsterReading();
diff --git a/src/imports/sensors/qmlhumiditysensor.cpp b/src/sensorsquick/qmlhumiditysensor.cpp
index 3b30e972..37bf7a18 100644
--- a/src/imports/sensors/qmlhumiditysensor.cpp
+++ b/src/sensorsquick/qmlhumiditysensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlhumiditysensor.h"
+#include "qmlhumiditysensor_p.h"
#include <QtSensors/QHumiditySensor>
/*!
diff --git a/src/imports/sensors/qmlhumiditysensor.h b/src/sensorsquick/qmlhumiditysensor_p.h
index a84a428e..7a940b7c 100644
--- a/src/imports/sensors/qmlhumiditysensor.h
+++ b/src/sensorsquick/qmlhumiditysensor_p.h
@@ -37,19 +37,32 @@
**
****************************************************************************/
-#ifndef QMLHUMIDITYSENSOR_H
-#define QMLHUMIDITYSENSOR_H
+#ifndef QMLHUMIDITYSENSOR_P_H
+#define QMLHUMIDITYSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QHumiditySensor;
-class QmlHumiditySensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlHumiditySensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(HumiditySensor)
+ QML_ADDED_IN_VERSION(5,9)
public:
explicit QmlHumiditySensor(QObject *parent = Q_NULLPTR);
~QmlHumiditySensor();
@@ -61,11 +74,14 @@ private:
QHumiditySensor *m_sensor;
};
-class QmlHumidityReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlHumidityReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal relativeHumidity READ relativeHumidity NOTIFY relativeHumidityChanged)
Q_PROPERTY(qreal absoluteHumidity READ absoluteHumidity NOTIFY absoluteHumidityChanged)
+ QML_NAMED_ELEMENT(HumidityReading)
+ QML_UNCREATABLE("Cannot create HumidityReading")
+ QML_ADDED_IN_VERSION(5,9)
public:
explicit QmlHumidityReading(QHumiditySensor *sensor);
~QmlHumidityReading();
diff --git a/src/imports/sensors/qmlirproximitysensor.cpp b/src/sensorsquick/qmlirproximitysensor.cpp
index 9b1e72ac..42e9cfe9 100644
--- a/src/imports/sensors/qmlirproximitysensor.cpp
+++ b/src/sensorsquick/qmlirproximitysensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlirproximitysensor.h"
+#include "qmlirproximitysensor_p.h"
#include <QtSensors/QIRProximitySensor>
/*!
diff --git a/src/imports/sensors/qmlirproximitysensor.h b/src/sensorsquick/qmlirproximitysensor_p.h
index 8ba1d489..6039794d 100644
--- a/src/imports/sensors/qmlirproximitysensor.h
+++ b/src/sensorsquick/qmlirproximitysensor_p.h
@@ -37,18 +37,31 @@
**
****************************************************************************/
-#ifndef QMLIRPROXIMITYSENSOR_H
-#define QMLIRPROXIMITYSENSOR_H
+#ifndef QMLIRPROXIMITYSENSOR_P_H
+#define QMLIRPROXIMITYSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QIRProximitySensor;
-class QmlIRProximitySensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlIRProximitySensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(IRProximitySensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlIRProximitySensor(QObject *parent = 0);
~QmlIRProximitySensor();
@@ -59,10 +72,13 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlIRProximitySensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlIRProximitySensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal reflectance READ reflectance NOTIFY reflectanceChanged)
+ QML_NAMED_ELEMENT(IRProximityReading)
+ QML_UNCREATABLE("Cannot create IRProximityReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlIRProximitySensorReading(QIRProximitySensor *sensor);
~QmlIRProximitySensorReading();
diff --git a/src/imports/sensors/qmllidsensor.cpp b/src/sensorsquick/qmllidsensor.cpp
index e6dfa4cb..3725f0ca 100644
--- a/src/imports/sensors/qmllidsensor.cpp
+++ b/src/sensorsquick/qmllidsensor.cpp
@@ -36,7 +36,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmllidsensor.h"
+#include "qmllidsensor_p.h"
#include <QtSensors/QLidSensor>
/*!
diff --git a/src/imports/sensors/qmllidsensor.h b/src/sensorsquick/qmllidsensor_p.h
index 37c2faeb..6a58ce53 100644
--- a/src/imports/sensors/qmllidsensor.h
+++ b/src/sensorsquick/qmllidsensor_p.h
@@ -36,18 +36,31 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QMLLIDSENSOR_H
-#define QMLLIDSENSOR_H
+#ifndef QMLLIDSENSOR_P_H
+#define QMLLIDSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QLidSensor;
-class QmlLidSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlLidSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(LidSensor)
+ QML_ADDED_IN_VERSION(5,9)
public:
explicit QmlLidSensor(QObject *parent = 0);
~QmlLidSensor();
@@ -59,11 +72,14 @@ private:
QLidSensor *m_sensor;
};
-class QmlLidReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlLidReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(bool backLidChanged READ backLidChanged NOTIFY backLidChanged)
Q_PROPERTY(bool frontLidClosed READ frontLidClosed NOTIFY frontLidChanged)
+ QML_NAMED_ELEMENT(LidReading)
+ QML_UNCREATABLE("Cannot create LidReading")
+ QML_ADDED_IN_VERSION(5,9)
public:
explicit QmlLidReading(QLidSensor *sensor);
~QmlLidReading();
diff --git a/src/imports/sensors/qmllightsensor.cpp b/src/sensorsquick/qmllightsensor.cpp
index 2c1eb860..f60390bf 100644
--- a/src/imports/sensors/qmllightsensor.cpp
+++ b/src/sensorsquick/qmllightsensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmllightsensor.h"
+#include "qmllightsensor_p.h"
#include <QtSensors/QLightSensor>
/*!
diff --git a/src/imports/sensors/qmllightsensor.h b/src/sensorsquick/qmllightsensor_p.h
index c77b4bfe..137be444 100644
--- a/src/imports/sensors/qmllightsensor.h
+++ b/src/sensorsquick/qmllightsensor_p.h
@@ -37,19 +37,32 @@
**
****************************************************************************/
-#ifndef QMLLightSensor_H
-#define QMLLightSensor_H
+#ifndef QMLLIGHTSENSOR_P_H
+#define QMLLIGHTSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QLightSensor;
-class QmlLightSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlLightSensor : public QmlSensor
{
Q_OBJECT
Q_PROPERTY(qreal fieldOfView READ fieldOfView NOTIFY fieldOfViewChanged)
+ QML_NAMED_ELEMENT(LightSensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlLightSensor(QObject *parent = 0);
~QmlLightSensor();
@@ -65,10 +78,13 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlLightSensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlLightSensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal illuminance READ illuminance NOTIFY illuminanceChanged)
+ QML_NAMED_ELEMENT(LightReading)
+ QML_UNCREATABLE("Cannot create LightReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlLightSensorReading(QLightSensor *sensor);
~QmlLightSensorReading();
diff --git a/src/imports/sensors/qmlmagnetometer.cpp b/src/sensorsquick/qmlmagnetometer.cpp
index dba0ec4e..e911d583 100644
--- a/src/imports/sensors/qmlmagnetometer.cpp
+++ b/src/sensorsquick/qmlmagnetometer.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlmagnetometer.h"
+#include "qmlmagnetometer_p.h"
#include <QtSensors/QMagnetometer>
/*!
diff --git a/src/imports/sensors/qmlmagnetometer.h b/src/sensorsquick/qmlmagnetometer_p.h
index 3c3c2bae..ef30f6ff 100644
--- a/src/imports/sensors/qmlmagnetometer.h
+++ b/src/sensorsquick/qmlmagnetometer_p.h
@@ -37,19 +37,32 @@
**
****************************************************************************/
-#ifndef QMLMAGNETOMETER_H
-#define QMLMAGNETOMETER_H
+#ifndef QMLMAGNETOMETER_P_H
+#define QMLMAGNETOMETER_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QMagnetometer;
-class QmlMagnetometer : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlMagnetometer : public QmlSensor
{
Q_OBJECT
Q_PROPERTY(bool returnGeoValues READ returnGeoValues WRITE setReturnGeoValues NOTIFY returnGeoValuesChanged)
+ QML_NAMED_ELEMENT(Magnetometer)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlMagnetometer(QObject *parent = 0);
~QmlMagnetometer();
@@ -66,13 +79,16 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlMagnetometerReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlMagnetometerReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal x READ x NOTIFY xChanged)
Q_PROPERTY(qreal y READ y NOTIFY yChanged)
Q_PROPERTY(qreal z READ z NOTIFY zChanged)
Q_PROPERTY(qreal calibrationLevel READ calibrationLevel NOTIFY calibrationLevelChanged)
+ QML_NAMED_ELEMENT(MagnetometerReading)
+ QML_UNCREATABLE("Cannot create MagnetometerReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlMagnetometerReading(QMagnetometer *sensor);
~QmlMagnetometerReading();
diff --git a/src/imports/sensors/qmlorientationsensor.cpp b/src/sensorsquick/qmlorientationsensor.cpp
index 25bda074..0cf9cc19 100644
--- a/src/imports/sensors/qmlorientationsensor.cpp
+++ b/src/sensorsquick/qmlorientationsensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlorientationsensor.h"
+#include "qmlorientationsensor_p.h"
#include <QtSensors/QOrientationSensor>
/*!
diff --git a/src/imports/sensors/qmlorientationsensor.h b/src/sensorsquick/qmlorientationsensor_p.h
index bdb1b1e4..4b04b3e8 100644
--- a/src/imports/sensors/qmlorientationsensor.h
+++ b/src/sensorsquick/qmlorientationsensor_p.h
@@ -37,19 +37,32 @@
**
****************************************************************************/
-#ifndef QMLORIENTATIONSENSOR_H
-#define QMLORIENTATIONSENSOR_H
+#ifndef QMLORIENTATIONSENSOR_P_H
+#define QMLORIENTATIONSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
#include <QtSensors/QOrientationSensor>
QT_BEGIN_NAMESPACE
class QOrientationSensor;
-class QmlOrientationSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlOrientationSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(OrientationSensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlOrientationSensor(QObject *parent = 0);
~QmlOrientationSensor();
@@ -61,10 +74,13 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlOrientationSensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlOrientationSensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(QOrientationReading::Orientation orientation READ orientation NOTIFY orientationChanged)
+ QML_NAMED_ELEMENT(OrientationReading)
+ QML_UNCREATABLE("Cannot create OrientationReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlOrientationSensorReading(QOrientationSensor *sensor);
diff --git a/src/imports/sensors/qmlpressuresensor.cpp b/src/sensorsquick/qmlpressuresensor.cpp
index 4ef27ba7..08a434b0 100644
--- a/src/imports/sensors/qmlpressuresensor.cpp
+++ b/src/sensorsquick/qmlpressuresensor.cpp
@@ -36,7 +36,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qmlpressuresensor.h"
+#include "qmlpressuresensor_p.h"
#include <QtSensors/QPressureSensor>
/*!
diff --git a/src/imports/sensors/qmlpressuresensor.h b/src/sensorsquick/qmlpressuresensor_p.h
index 6304d69c..b4b353d1 100644
--- a/src/imports/sensors/qmlpressuresensor.h
+++ b/src/sensorsquick/qmlpressuresensor_p.h
@@ -36,18 +36,31 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QMLPRESSURESENSOR_H
-#define QMLPRESSURESENSOR_H
+#ifndef QMLPRESSURESENSOR_P_H
+#define QMLPRESSURESENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QPressureSensor;
-class QmlPressureSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlPressureSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(PressureSensor)
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlPressureSensor(QObject *parent = 0);
~QmlPressureSensor();
@@ -59,11 +72,14 @@ private:
QPressureSensor *m_sensor;
};
-class QmlPressureReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlPressureReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal pressure READ pressure NOTIFY pressureChanged)
Q_PROPERTY(qreal temperature READ temperature NOTIFY temperatureChanged REVISION 1)
+ QML_NAMED_ELEMENT(PressureReading)
+ QML_UNCREATABLE("Cannot create PressureReading")
+ QML_ADDED_IN_VERSION(5,1)
public:
explicit QmlPressureReading(QPressureSensor *sensor);
~QmlPressureReading();
diff --git a/src/imports/sensors/qmlproximitysensor.cpp b/src/sensorsquick/qmlproximitysensor.cpp
index 84993574..73767f64 100644
--- a/src/imports/sensors/qmlproximitysensor.cpp
+++ b/src/sensorsquick/qmlproximitysensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlproximitysensor.h"
+#include "qmlproximitysensor_p.h"
#include <QtSensors/QProximitySensor>
/*!
diff --git a/src/imports/sensors/qmlproximitysensor.h b/src/sensorsquick/qmlproximitysensor_p.h
index 8bab8cfa..9d28dfcf 100644
--- a/src/imports/sensors/qmlproximitysensor.h
+++ b/src/sensorsquick/qmlproximitysensor_p.h
@@ -37,10 +37,21 @@
**
****************************************************************************/
-#ifndef QMLPROXIMITYSENSOR_H
-#define QMLPROXIMITYSENSOR_H
+#ifndef QMLPROXIMITYSENSOR_P_H
+#define QMLPROXIMITYSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
#ifdef near
#undef near
#endif
@@ -48,9 +59,11 @@ QT_BEGIN_NAMESPACE
class QProximitySensor;
-class QmlProximitySensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlProximitySensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(ProximitySensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlProximitySensor(QObject *parent = 0);
~QmlProximitySensor();
@@ -62,10 +75,13 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlProximitySensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlProximitySensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(bool near READ near NOTIFY nearChanged)
+ QML_NAMED_ELEMENT(ProximityReading)
+ QML_UNCREATABLE("Cannot create ProximityReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlProximitySensorReading(QProximitySensor *sensor);
~QmlProximitySensorReading();
diff --git a/src/imports/sensors/qmlrotationsensor.cpp b/src/sensorsquick/qmlrotationsensor.cpp
index ffa47fd9..ef04c6bb 100644
--- a/src/imports/sensors/qmlrotationsensor.cpp
+++ b/src/sensorsquick/qmlrotationsensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlrotationsensor.h"
+#include "qmlrotationsensor_p.h"
#include <QtSensors/QRotationSensor>
/*!
diff --git a/src/imports/sensors/qmlrotationsensor.h b/src/sensorsquick/qmlrotationsensor_p.h
index c0760ac9..f14ad791 100644
--- a/src/imports/sensors/qmlrotationsensor.h
+++ b/src/sensorsquick/qmlrotationsensor_p.h
@@ -37,19 +37,32 @@
**
****************************************************************************/
-#ifndef QMLROTATIONSENSOR_H
-#define QMLROTATIONSENSOR_H
+#ifndef QMLROTATIONSENSOR_P_H
+#define QMLROTATIONSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
QT_BEGIN_NAMESPACE
class QRotationSensor;
-class QmlRotationSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlRotationSensor : public QmlSensor
{
Q_OBJECT
Q_PROPERTY(bool hasZ READ hasZ NOTIFY hasZChanged)
+ QML_NAMED_ELEMENT(RotationSensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlRotationSensor(QObject *parent = 0);
~QmlRotationSensor();
@@ -66,12 +79,15 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlRotationSensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlRotationSensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal x READ x NOTIFY xChanged)
Q_PROPERTY(qreal y READ y NOTIFY yChanged)
Q_PROPERTY(qreal z READ z NOTIFY zChanged)
+ QML_NAMED_ELEMENT(RotationReading)
+ QML_UNCREATABLE("Cannot create RotationReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlRotationSensorReading(QRotationSensor *sensor);
~QmlRotationSensorReading();
diff --git a/src/imports/sensors/qmlsensor.cpp b/src/sensorsquick/qmlsensor.cpp
index be1f4588..0afa91ea 100644
--- a/src/imports/sensors/qmlsensor.cpp
+++ b/src/sensorsquick/qmlsensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlsensor.h"
+#include "qmlsensor_p.h"
#include <QtSensors/QSensor>
#include <QDebug>
#include <QtCore/private/qobject_p.h>
diff --git a/src/imports/sensors/qmlsensor.h b/src/sensorsquick/qmlsensor_p.h
index 3ac82699..f31ee1bf 100644
--- a/src/imports/sensors/qmlsensor.h
+++ b/src/sensorsquick/qmlsensor_p.h
@@ -37,13 +37,27 @@
**
****************************************************************************/
-#ifndef QMLSENSOR_H
-#define QMLSENSOR_H
+#ifndef QMLSENSOR_P_H
+#define QMLSENSOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qsensorsquickglobal_p.h"
#include <QObject>
#include <QQmlParserStatus>
+#include <QtQml/qqml.h>
#include <QQmlListProperty>
-#include "qmlsensorrange.h"
+#include "qmlsensorrange_p.h"
QT_BEGIN_NAMESPACE
@@ -53,7 +67,7 @@ class QSensorReading;
class QmlSensorReading;
class QmlSensorPrivate;
-class QmlSensor : public QObject, public QQmlParserStatus
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensor : public QObject, public QQmlParserStatus
{
Q_OBJECT
Q_DECLARE_PRIVATE(QmlSensor)
@@ -80,6 +94,9 @@ class QmlSensor : public QObject, public QQmlParserStatus
Q_PROPERTY(int efficientBufferSize READ efficientBufferSize NOTIFY efficientBufferSizeChanged REVISION 1)
Q_PROPERTY(int bufferSize READ bufferSize WRITE setBufferSize NOTIFY bufferSizeChanged REVISION 1)
+ QML_NAMED_ELEMENT(Sensor)
+ QML_UNCREATABLE("Cannot create Sensor")
+ QML_ADDED_IN_VERSION(5,0)
public:
// Keep in sync with QSensor::AxesOrientationMode
enum AxesOrientationMode {
@@ -181,10 +198,13 @@ private:
QmlSensorReading *m_reading;
};
-class QmlSensorReading : public QObject
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensorReading : public QObject
{
Q_OBJECT
Q_PROPERTY(quint64 timestamp READ timestamp NOTIFY timestampChanged)
+ QML_NAMED_ELEMENT(SensorReading)
+ QML_UNCREATABLE("Cannot create SensorReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlSensorReading(QSensor *sensor);
~QmlSensorReading();
diff --git a/src/imports/sensors/qmlsensorgesture.cpp b/src/sensorsquick/qmlsensorgesture.cpp
index 2e7f104c..2879995c 100644
--- a/src/imports/sensors/qmlsensorgesture.cpp
+++ b/src/sensorsquick/qmlsensorgesture.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlsensorgesture.h"
+#include "qmlsensorgesture_p.h"
#include <QtSensors/qsensorgesture.h>
#include <QtSensors/qsensorgesturemanager.h>
diff --git a/src/imports/sensors/qmlsensorgesture.h b/src/sensorsquick/qmlsensorgesture_p.h
index 7cd4acaa..75f3e19a 100644
--- a/src/imports/sensors/qmlsensorgesture.h
+++ b/src/sensorsquick/qmlsensorgesture_p.h
@@ -37,18 +37,32 @@
**
****************************************************************************/
-#ifndef QMLSENSORGESTURE_H
-#define QMLSENSORGESTURE_H
+#ifndef QMLSENSORGESTURE_P_H
+#define QMLSENSORGESTURE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QQmlParserStatus>
+#include <QtQml/qqml.h>
#include <QStringList>
+#include "qsensorsquickglobal_p.h"
+
QT_BEGIN_NAMESPACE
class QSensorGesture;
class QSensorGestureManager;
-class QmlSensorGesture : public QObject, public QQmlParserStatus
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensorGesture : public QObject, public QQmlParserStatus
{
Q_OBJECT
Q_PROPERTY(QStringList availableGestures READ availableGestures NOTIFY availableGesturesChanged)
@@ -57,6 +71,8 @@ class QmlSensorGesture : public QObject, public QQmlParserStatus
Q_PROPERTY(QStringList invalidGestures READ invalidGestures NOTIFY invalidGesturesChanged)
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
Q_INTERFACES(QQmlParserStatus)
+ QML_NAMED_ELEMENT(SensorGesture)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlSensorGesture(QObject* parent = 0);
diff --git a/src/imports/sensors/qmlsensorglobal.cpp b/src/sensorsquick/qmlsensorglobal.cpp
index c2a67e85..4699a33d 100644
--- a/src/imports/sensors/qmlsensorglobal.cpp
+++ b/src/sensorsquick/qmlsensorglobal.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlsensorglobal.h"
+#include "qmlsensorglobal_p.h"
#include <QtSensors/QSensor>
QT_BEGIN_NAMESPACE
diff --git a/src/imports/sensors/qmlsensorglobal.h b/src/sensorsquick/qmlsensorglobal_p.h
index b6524cd2..cf570d90 100644
--- a/src/imports/sensors/qmlsensorglobal.h
+++ b/src/sensorsquick/qmlsensorglobal_p.h
@@ -37,9 +37,22 @@
**
****************************************************************************/
-#ifndef QMLSENSORGLOBAL_H
-#define QMLSENSORGLOBAL_H
+#ifndef QMLSENSORGLOBAL_P_H
+#define QMLSENSORGLOBAL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qsensorsquickglobal_p.h"
+#include <QtQml/qqml.h>
#include <QObject>
#include <QStringList>
@@ -47,7 +60,7 @@ QT_BEGIN_NAMESPACE
class QSensor;
-class QmlSensorGlobal : public QObject
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensorGlobal : public QObject
{
Q_OBJECT
public:
@@ -57,6 +70,9 @@ public:
Q_INVOKABLE QStringList sensorTypes() const;
Q_INVOKABLE QStringList sensorsForType(const QString &type) const;
Q_INVOKABLE QString defaultSensorForType(const QString &type) const;
+ QML_NAMED_ELEMENT(QmlSensors)
+ QML_SINGLETON
+ QML_ADDED_IN_VERSION(5,0)
Q_SIGNALS:
void availableSensorsChanged();
diff --git a/src/imports/sensors/qmlsensorrange.cpp b/src/sensorsquick/qmlsensorrange.cpp
index 128f4a65..3e9a56b2 100644
--- a/src/imports/sensors/qmlsensorrange.cpp
+++ b/src/sensorsquick/qmlsensorrange.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmlsensorrange.h"
+#include "qmlsensorrange_p.h"
QmlSensorRange::QmlSensorRange(QObject *parent)
: QObject(parent),
diff --git a/src/imports/sensors/qmlsensorrange.h b/src/sensorsquick/qmlsensorrange_p.h
index 4c638f6f..7e32ede2 100644
--- a/src/imports/sensors/qmlsensorrange.h
+++ b/src/sensorsquick/qmlsensorrange_p.h
@@ -37,18 +37,34 @@
**
****************************************************************************/
-#ifndef QMLSENSORRANGE_H
-#define QMLSENSORRANGE_H
+#ifndef QMLSENSORRANGE_P_H
+#define QMLSENSORRANGE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqml.h>
#include <QObject>
+#include "qsensorsquickglobal_p.h"
QT_BEGIN_NAMESPACE
-class QmlSensorRange : public QObject
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensorRange : public QObject
{
Q_OBJECT
Q_PROPERTY(int minimum READ minimum)
Q_PROPERTY(int maximum READ maximum)
+ QML_NAMED_ELEMENT(Range)
+ QML_UNCREATABLE("Cannot create Range")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlSensorRange(QObject *parent = 0);
~QmlSensorRange();
@@ -65,12 +81,15 @@ private:
int max;
};
-class QmlSensorOutputRange : public QObject
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensorOutputRange : public QObject
{
Q_OBJECT
Q_PROPERTY(qreal minimum READ minimum)
Q_PROPERTY(qreal maximum READ maximum)
Q_PROPERTY(qreal accuracy READ accuracy)
+ QML_NAMED_ELEMENT(OutputRange)
+ QML_UNCREATABLE("Cannot create OutputRange")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlSensorOutputRange(QObject *parent = 0);
~QmlSensorOutputRange();
diff --git a/src/imports/sensors/qmltapsensor.cpp b/src/sensorsquick/qmltapsensor.cpp
index 76f34c2e..faeba623 100644
--- a/src/imports/sensors/qmltapsensor.cpp
+++ b/src/sensorsquick/qmltapsensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmltapsensor.h"
+#include "qmltapsensor_p.h"
#include <QtSensors/QTapSensor>
/*!
diff --git a/src/imports/sensors/qmltapsensor.h b/src/sensorsquick/qmltapsensor_p.h
index 260cb2c2..7d8800c0 100644
--- a/src/imports/sensors/qmltapsensor.h
+++ b/src/sensorsquick/qmltapsensor_p.h
@@ -37,20 +37,33 @@
**
****************************************************************************/
-#ifndef QMLTAPSENSOR_H
-#define QMLTAPSENSOR_H
+#ifndef QMLTAPSENSOR_P_H
+#define QMLTAPSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
#include <QtSensors/QTapSensor>
QT_BEGIN_NAMESPACE
class QTapSensor;
-class QmlTapSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlTapSensor : public QmlSensor
{
Q_OBJECT
Q_PROPERTY(bool returnDoubleTapEvents READ returnDoubleTapEvents WRITE setReturnDoubleTapEvents NOTIFY returnDoubleTapEventsChanged)
+ QML_NAMED_ELEMENT(TapSensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlTapSensor(QObject *parent = 0);
~QmlTapSensor();
@@ -67,11 +80,14 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlTapSensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlTapSensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(QTapReading::TapDirection tapDirection READ tapDirection NOTIFY tapDirectionChanged)
Q_PROPERTY(bool doubleTap READ isDoubleTap NOTIFY isDoubleTapChanged)
+ QML_NAMED_ELEMENT(TapReading)
+ QML_UNCREATABLE("Cannot create TapReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlTapSensorReading(QTapSensor *sensor);
diff --git a/src/imports/sensors/qmltiltsensor.cpp b/src/sensorsquick/qmltiltsensor.cpp
index 6129a5c9..81b4e696 100644
--- a/src/imports/sensors/qmltiltsensor.cpp
+++ b/src/sensorsquick/qmltiltsensor.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qmltiltsensor.h"
+#include "qmltiltsensor_p.h"
#include <QtSensors/qtiltsensor.h>
QT_BEGIN_NAMESPACE
diff --git a/src/imports/sensors/qmltiltsensor.h b/src/sensorsquick/qmltiltsensor_p.h
index c922cb8c..f41757b3 100644
--- a/src/imports/sensors/qmltiltsensor.h
+++ b/src/sensorsquick/qmltiltsensor_p.h
@@ -37,19 +37,32 @@
**
****************************************************************************/
-#ifndef QMLTILTSENSOR_H
-#define QMLTILTSENSOR_H
+#ifndef QMLTILTSENSOR_P_H
+#define QMLTILTSENSOR_P_H
-#include "qmlsensor.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qmlsensor_p.h"
#include <QtSensors/QTiltSensor>
QT_BEGIN_NAMESPACE
class QTiltSensor;
-class QmlTiltSensor : public QmlSensor
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlTiltSensor : public QmlSensor
{
Q_OBJECT
+ QML_NAMED_ELEMENT(TiltSensor)
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlTiltSensor(QObject *parent = 0);
@@ -62,11 +75,14 @@ private:
QmlSensorReading *createReading() const override;
};
-class QmlTiltSensorReading : public QmlSensorReading
+class Q_SENSORSQUICK_PRIVATE_EXPORT QmlTiltSensorReading : public QmlSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal yRotation READ yRotation NOTIFY yRotationChanged)
Q_PROPERTY(qreal xRotation READ xRotation NOTIFY xRotationChanged)
+ QML_NAMED_ELEMENT(TiltReading)
+ QML_UNCREATABLE("Cannot create TiltReading")
+ QML_ADDED_IN_VERSION(5,0)
public:
explicit QmlTiltSensorReading(QTiltSensor *sensor);
~QmlTiltSensorReading();
diff --git a/src/sensorsquick/qsensorsquickglobal_p.h b/src/sensorsquick/qsensorsquickglobal_p.h
new file mode 100644
index 00000000..4f6034f6
--- /dev/null
+++ b/src/sensorsquick/qsensorsquickglobal_p.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSENSORSQUICKGLOBALS_P_H
+#define QSENSORSQUICKGLOBALS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+#if !defined(QT_STATIC)
+# if defined(QT_BUILD_SENSORSQUICK_LIB)
+# define Q_SENSORSQUICK_EXPORT Q_DECL_EXPORT
+# else
+# define Q_SENSORSQUICK_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define Q_SENSORSQUICK_EXPORT
+#endif
+
+#define Q_SENSORSQUICK_PRIVATE_EXPORT Q_SENSORSQUICK_EXPORT
+
+QT_END_NAMESPACE
+
+void Q_SENSORSQUICK_PRIVATE_EXPORT qml_register_types_QtSensors();
+
+#endif // QSENSORSQUICKGLOBALS_P_H