summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2021-01-06 07:30:03 +1000
committerJuha Vuolle <juha.vuolle@insta.fi>2021-04-19 13:29:47 +0300
commit45c8ae3232df8955644697ee88c4321f26bb5cf2 (patch)
tree77edea26c249ce6bb8a921fe67c266d3c95e094a /src
parent5a8aa096dc61336ac95734e8cc61f106e359c865 (diff)
QtSensors initial cmake support
This commit introduces the bare minimum cmake support that should unblock the CI and allow further verification and development on most platforms: macOS, Linux, Win, iOS and Android. Some clarifications: * The support for sensorfw backend is very preliminary and can be enabled later if needed (no Qt6 version of the sensorfw). * The simulator backend is dropped as obsolete / unnecessary. * Three examples are currently commented out and shall be ported with a later commit. Task-number: QTBUG-92502 Change-Id: Id523d43ed3ef177010dc73afc5812ed374cff0dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/imports/CMakeLists.txt2
-rw-r--r--src/imports/imports.pro4
-rw-r--r--src/imports/sensors/CMakeLists.txt42
-rw-r--r--src/imports/sensors/sensors.pro56
-rw-r--r--src/plugins/CMakeLists.txt2
-rw-r--r--src/plugins/plugins.pro3
-rw-r--r--src/plugins/sensorgestures/CMakeLists.txt2
-rw-r--r--src/plugins/sensorgestures/qtsensors/CMakeLists.txt29
-rw-r--r--src/plugins/sensorgestures/qtsensors/qtsensors.pro37
-rw-r--r--src/plugins/sensorgestures/sensorgestures.pro2
-rw-r--r--src/plugins/sensorgestures/shake/CMakeLists.txt19
-rw-r--r--src/plugins/sensorgestures/shake/shake.pro16
-rw-r--r--src/plugins/sensors/CMakeLists.txt39
-rw-r--r--src/plugins/sensors/android/CMakeLists.txt32
-rw-r--r--src/plugins/sensors/android/android.pro41
-rw-r--r--src/plugins/sensors/dummy/CMakeLists.txt27
-rw-r--r--src/plugins/sensors/dummy/dummy.pro19
-rw-r--r--src/plugins/sensors/generic/CMakeLists.txt33
-rw-r--r--src/plugins/sensors/generic/generic.pro29
-rw-r--r--src/plugins/sensors/iio-sensor-proxy/CMakeLists.txt41
-rw-r--r--src/plugins/sensors/iio-sensor-proxy/iio-sensor-proxy.pro31
-rw-r--r--src/plugins/sensors/ios/CMakeLists.txt50
-rw-r--r--src/plugins/sensors/ios/ios.pro49
-rw-r--r--src/plugins/sensors/linux/CMakeLists.txt25
-rw-r--r--src/plugins/sensors/linux/linux.pro13
-rw-r--r--src/plugins/sensors/sensorfw/CMakeLists.txt36
-rw-r--r--src/plugins/sensors/sensorfw/sensorfw.pro16
-rw-r--r--src/plugins/sensors/sensorfw/sensorfwsensorbase.h2
-rw-r--r--src/plugins/sensors/sensors.pro45
-rw-r--r--src/plugins/sensors/sensortag/CMakeLists.txt26
-rw-r--r--src/plugins/sensors/sensortag/sensortag.pro11
-rw-r--r--src/plugins/sensors/simulator/main.cpp143
-rw-r--r--src/plugins/sensors/simulator/plugin.json1
-rw-r--r--src/plugins/sensors/simulator/qsensordata_simulator.cpp143
-rw-r--r--src/plugins/sensors/simulator/qsensordata_simulator_p.h128
-rw-r--r--src/plugins/sensors/simulator/simulator.pro32
-rw-r--r--src/plugins/sensors/simulator/simulatoraccelerometer.cpp71
-rw-r--r--src/plugins/sensors/simulator/simulatoraccelerometer.h59
-rw-r--r--src/plugins/sensors/simulator/simulatorambientlightsensor.cpp89
-rw-r--r--src/plugins/sensors/simulator/simulatorambientlightsensor.h59
-rw-r--r--src/plugins/sensors/simulator/simulatorcommon.cpp252
-rw-r--r--src/plugins/sensors/simulator/simulatorcommon.h105
-rw-r--r--src/plugins/sensors/simulator/simulatorcompass.cpp69
-rw-r--r--src/plugins/sensors/simulator/simulatorcompass.h59
-rw-r--r--src/plugins/sensors/simulator/simulatorirproximitysensor.cpp67
-rw-r--r--src/plugins/sensors/simulator/simulatorirproximitysensor.h59
-rw-r--r--src/plugins/sensors/simulator/simulatorlightsensor.cpp67
-rw-r--r--src/plugins/sensors/simulator/simulatorlightsensor.h59
-rw-r--r--src/plugins/sensors/simulator/simulatormagnetometer.cpp73
-rw-r--r--src/plugins/sensors/simulator/simulatormagnetometer.h59
-rw-r--r--src/plugins/sensors/simulator/simulatorproximitysensor.cpp67
-rw-r--r--src/plugins/sensors/simulator/simulatorproximitysensor.h59
-rw-r--r--src/plugins/sensors/winrt/CMakeLists.txt26
-rw-r--r--src/plugins/sensors/winrt/winrt.pro29
-rw-r--r--src/sensors/CMakeLists.txt108
-rw-r--r--src/sensors/configure.cmake38
-rw-r--r--src/sensors/doc/snippets/sensorgestures/CMakeLists.txt28
-rw-r--r--src/sensors/doc/snippets/sensorgestures/sensorgestures.pro8
-rw-r--r--src/sensors/doc/snippets/sensors/CMakeLists.txt28
-rw-r--r--src/sensors/doc/snippets/sensors/sensors.pro10
-rw-r--r--src/sensors/doc/snippets/snippets.pro5
-rw-r--r--src/sensors/gestures/qsensorgesturemanagerprivate.cpp59
-rw-r--r--src/sensors/gestures/qsensorgesturemanagerprivate_p.h14
-rw-r--r--src/sensors/gestures/qsensorgesturerecognizer.cpp17
-rw-r--r--src/sensors/gestures/simulatorgesturescommon.cpp121
-rw-r--r--src/sensors/gestures/simulatorgesturescommon_p.h92
-rw-r--r--src/sensors/qsensor.cpp5
-rw-r--r--src/sensors/qt_cmdline.cmake0
-rw-r--r--src/sensors/sensors.pro87
-rw-r--r--src/src.pro18
71 files changed, 643 insertions, 2554 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 00000000..9a363951
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_subdirectory(sensors)
+add_subdirectory(plugins)
+if(TARGET Qt::Quick)
+ add_subdirectory(imports)
+endif()
diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt
new file mode 100644
index 00000000..3fdc4441
--- /dev/null
+++ b/src/imports/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+add_subdirectory(sensors)
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
deleted file mode 100644
index a68f6a5e..00000000
--- a/src/imports/imports.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += sensors
-
diff --git a/src/imports/sensors/CMakeLists.txt b/src/imports/sensors/CMakeLists.txt
new file mode 100644
index 00000000..87414bde
--- /dev/null
+++ b/src/imports/sensors/CMakeLists.txt
@@ -0,0 +1,42 @@
+
+# TODO Qt 6.2 split into separate QML library + plugin
+
+qt_internal_add_qml_module(sensors
+ URI "QtSensors"
+ VERSION "${CMAKE_PROJECT_VERSION}"
+ CLASSNAME QtSensorsDeclarativeModule
+ SKIP_TYPE_REGISTRATION
+ 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
+)
diff --git a/src/imports/sensors/sensors.pro b/src/imports/sensors/sensors.pro
deleted file mode 100644
index 7d15ec9f..00000000
--- a/src/imports/sensors/sensors.pro
+++ /dev/null
@@ -1,56 +0,0 @@
-QT += core-private qml sensors sensors-private
-
-HEADERS += \
- qmlsensor.h \
- qmlsensorrange.h \
- qmlaccelerometer.h \
- qmlaltimeter.h \
- qmlambientlightsensor.h \
- qmlambienttemperaturesensor.h \
- qmlcompass.h \
- qmldistancesensor.h \
- qmlgyroscope.h \
- qmlholstersensor.h \
- qmlirproximitysensor.h \
- qmllightsensor.h \
- qmlmagnetometer.h \
- qmlorientationsensor.h \
- qmlpressuresensor.h\
- qmlproximitysensor.h \
- qmltapsensor.h \
- qmlrotationsensor.h \
- qmlsensorglobal.h \
- qmltiltsensor.h \
- qmlsensorgesture.h \
- qmlhumiditysensor.h \
- qmllidsensor.h
-
-SOURCES += sensors.cpp \
- qmlsensor.cpp \
- qmlsensorrange.cpp \
- qmlaccelerometer.cpp \
- qmlaltimeter.cpp \
- qmlambientlightsensor.cpp \
- qmlambienttemperaturesensor.cpp \
- qmlcompass.cpp \
- qmldistancesensor.cpp \
- qmlgyroscope.cpp \
- qmlholstersensor.cpp \
- qmlirproximitysensor.cpp \
- qmllightsensor.cpp \
- qmlmagnetometer.cpp \
- qmlorientationsensor.cpp \
- qmlpressuresensor.cpp\
- qmlproximitysensor.cpp \
- qmltapsensor.cpp \
- qmlrotationsensor.cpp \
- qmlsensorglobal.cpp \
- qmltiltsensor.cpp \
- qmlsensorgesture.cpp \
- qmlhumiditysensor.cpp \
- qmllidsensor.cpp
-
-load(qml_plugin)
-
-OTHER_FILES += \
- plugin.json qmldir plugins.qmltypes
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
new file mode 100644
index 00000000..fdcb878d
--- /dev/null
+++ b/src/plugins/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(sensors)
+add_subdirectory(sensorgestures)
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
deleted file mode 100644
index c8b9e6ab..00000000
--- a/src/plugins/plugins.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += sensors
-SUBDIRS += sensorgestures
diff --git a/src/plugins/sensorgestures/CMakeLists.txt b/src/plugins/sensorgestures/CMakeLists.txt
new file mode 100644
index 00000000..07fbacc9
--- /dev/null
+++ b/src/plugins/sensorgestures/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(shake)
+add_subdirectory(qtsensors)
diff --git a/src/plugins/sensorgestures/qtsensors/CMakeLists.txt b/src/plugins/sensorgestures/qtsensors/CMakeLists.txt
new file mode 100644
index 00000000..16b76086
--- /dev/null
+++ b/src/plugins/sensorgestures/qtsensors/CMakeLists.txt
@@ -0,0 +1,29 @@
+#####################################################################
+## QtSensorGesturePlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(QtSensorGesturePlugin
+ OUTPUT_NAME qtsensorgestures_plugin
+ TYPE sensorgestures
+ DEFAULT_IF FALSE
+ SOURCES
+ qcoversensorgesturerecognizer.cpp qcoversensorgesturerecognizer.h
+ qdoubletapsensorgesturerecognizer.cpp qdoubletapsensorgesturerecognizer.h
+ qfreefallsensorgesturerecognizer.cpp qfreefallsensorgesturerecognizer.h
+ qhoversensorgesturerecognizer.cpp qhoversensorgesturerecognizer.h
+ qpickupsensorgesturerecognizer.cpp qpickupsensorgesturerecognizer.h
+ qshake2recognizer.cpp qshake2recognizer.h
+ qslamgesturerecognizer.cpp qslamgesturerecognizer.h
+ qtsensorgestureplugin.cpp qtsensorgestureplugin.h
+ qtsensorgesturesensorhandler.cpp qtsensorgesturesensorhandler.h
+ qturnoversensorgesturerecognizer.cpp qturnoversensorgesturerecognizer.h
+ qtwistsensorgesturerecognizer.cpp qtwistsensorgesturerecognizer.h
+ qwhipsensorgesturerecognizer.cpp qwhipsensorgesturerecognizer.h
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Sensors
+)
+
+#### Keys ignored in scope 1:.:.:qtsensors.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
+# PLUGIN_EXTENDS = "-"
diff --git a/src/plugins/sensorgestures/qtsensors/qtsensors.pro b/src/plugins/sensorgestures/qtsensors/qtsensors.pro
deleted file mode 100644
index 44f18ff5..00000000
--- a/src/plugins/sensorgestures/qtsensors/qtsensors.pro
+++ /dev/null
@@ -1,37 +0,0 @@
-TARGET = qtsensorgestures_plugin
-QT = core sensors
-
-# Input
-HEADERS += qtsensorgestureplugin.h \
- qcoversensorgesturerecognizer.h \
- qdoubletapsensorgesturerecognizer.h \
- qhoversensorgesturerecognizer.h \
- qfreefallsensorgesturerecognizer.h \
- qpickupsensorgesturerecognizer.h \
- qshake2recognizer.h \
- qslamgesturerecognizer.h \
- qturnoversensorgesturerecognizer.h \
- qtwistsensorgesturerecognizer.h \
- qwhipsensorgesturerecognizer.h \
- qtsensorgesturesensorhandler.h
-
-SOURCES += qtsensorgestureplugin.cpp \
- qcoversensorgesturerecognizer.cpp \
- qdoubletapsensorgesturerecognizer.cpp \
- qhoversensorgesturerecognizer.cpp \
- qfreefallsensorgesturerecognizer.cpp \
- qpickupsensorgesturerecognizer.cpp \
- qshake2recognizer.cpp \
- qslamgesturerecognizer.cpp \
- qturnoversensorgesturerecognizer.cpp \
- qtwistsensorgesturerecognizer.cpp \
- qwhipsensorgesturerecognizer.cpp \
- qtsensorgesturesensorhandler.cpp
-
-OTHER_FILES += \
- plugin.json
-
-PLUGIN_TYPE = sensorgestures
-PLUGIN_CLASS_NAME = QtSensorGesturePlugin
-PLUGIN_EXTENDS = -
-load(qt_plugin)
diff --git a/src/plugins/sensorgestures/sensorgestures.pro b/src/plugins/sensorgestures/sensorgestures.pro
deleted file mode 100644
index 162fb8eb..00000000
--- a/src/plugins/sensorgestures/sensorgestures.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += shake qtsensors
diff --git a/src/plugins/sensorgestures/shake/CMakeLists.txt b/src/plugins/sensorgestures/shake/CMakeLists.txt
new file mode 100644
index 00000000..489881aa
--- /dev/null
+++ b/src/plugins/sensorgestures/shake/CMakeLists.txt
@@ -0,0 +1,19 @@
+#####################################################################
+## QShakeSensorGesturePlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(QShakeSensorGesturePlugin
+ OUTPUT_NAME qtsensorgestures_shakeplugin
+ TYPE sensorgestures
+ DEFAULT_IF FALSE
+ SOURCES
+ qshakerecognizer.cpp qshakerecognizer.h
+ qshakesensorgestureplugin.cpp qshakesensorgestureplugin.h
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Sensors
+)
+
+#### Keys ignored in scope 1:.:.:shake.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
+# PLUGIN_EXTENDS = "-"
diff --git a/src/plugins/sensorgestures/shake/shake.pro b/src/plugins/sensorgestures/shake/shake.pro
deleted file mode 100644
index efa2a0cb..00000000
--- a/src/plugins/sensorgestures/shake/shake.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TARGET = qtsensorgestures_shakeplugin
-QT = core sensors
-
-# Input
-HEADERS += qshakesensorgestureplugin.h \
- qshakerecognizer.h
-SOURCES += qshakesensorgestureplugin.cpp \
- qshakerecognizer.cpp
-
-OTHER_FILES += \
- plugin.json
-
-PLUGIN_TYPE = sensorgestures
-PLUGIN_CLASS_NAME = QShakeSensorGesturePlugin
-PLUGIN_EXTENDS = -
-load(qt_plugin)
diff --git a/src/plugins/sensors/CMakeLists.txt b/src/plugins/sensors/CMakeLists.txt
new file mode 100644
index 00000000..08bfa26a
--- /dev/null
+++ b/src/plugins/sensors/CMakeLists.txt
@@ -0,0 +1,39 @@
+# all get generic sensor
+add_subdirectory(generic)
+
+if(ANDROID AND NOT SENSORS_PLUGINS OR "sensorfw" IN_LIST SENSORS_PLUGINS)
+ add_subdirectory(android)
+endif()
+
+# Currently disabled, see src/sensors/configure.cmake
+#if (QT_FEATURE_sensorfw AND NOT SENSORS_PLUGINS OR "sensorfw" IN_LIST SENSORS_PLUGINS)
+# add_subdirectory(sensorfw)
+#endif()
+
+if (WIN32 AND NOT SENSORS_PLUGINS OR "winrt" IN_LIST SENSORS_PLUGINS)
+ add_subdirectory(winrt)
+endif()
+
+if (LINUX AND NOT SENSORS_PLUGINS OR "linux" IN_LIST SENSORS_PLUGINS)
+ add_subdirectory(linux)
+endif()
+
+if (IOS AND NOT SENSORS_PLUGINS OR "ios" IN_LIST SENSORS_PLUGINS)
+ add_subdirectory(ios)
+endif()
+
+if(LINUX AND TARGET Qt::DBus AND NOT SENSORS_PLUGINS OR "iio-sensor-proxy" IN_LIST SENSORS_PLUGINS)
+ add_subdirectory(iio-sensor-proxy)
+endif()
+
+if(LINUX AND TARGET Qt::Bluetooth AND NOT SENSORS_PLUGINS OR "sensortag" IN_LIST SENSORS_PLUGINS)
+ if (TARGET Qt::Bluetooth)
+ add_subdirectory(sensortag)
+ else()
+ message(WARNING "You have configured for sensortag, but Qt Bluetooth module was not found.")
+ endif()
+endif()
+
+if(NOT SENSORS_PLUGINS OR "dummy" IN_LIST SENSORS_PLUGINS)
+ add_subdirectory(dummy)
+endif()
diff --git a/src/plugins/sensors/android/CMakeLists.txt b/src/plugins/sensors/android/CMakeLists.txt
new file mode 100644
index 00000000..76ee4091
--- /dev/null
+++ b/src/plugins/sensors/android/CMakeLists.txt
@@ -0,0 +1,32 @@
+#####################################################################
+## QCounterGesturePlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(AndroidSensorPlugin
+ OUTPUT_NAME qtsensors_android
+ TYPE sensors
+ SOURCES
+ androidaccelerometer.cpp androidaccelerometer.h
+ androidcompass.cpp androidcompass.h
+ androidgyroscope.cpp androidgyroscope.h
+ androidlight.cpp androidlight.h
+ androidmagnetometer.cpp androidmagnetometer.h
+ androidpressure.cpp androidpressure.h
+ androidproximity.cpp androidproximity.h
+ androidrotation.cpp androidrotation.h
+ androidtemperature.cpp androidtemperature.h
+ main.cpp
+ sensoreventqueue.h
+ sensormanager.cpp sensormanager.h
+ DEFINES
+ # STATICPLUGIN needed because there's a Q_IMPORT_PLUGIN in main.cpp
+ # Yes, the plugin imports itself statically
+ QT_STATICPLUGIN
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Sensors
+ android
+)
+
+#### Keys ignored in scope 1:.:.:android.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
diff --git a/src/plugins/sensors/android/android.pro b/src/plugins/sensors/android/android.pro
deleted file mode 100644
index 15e26ee9..00000000
--- a/src/plugins/sensors/android/android.pro
+++ /dev/null
@@ -1,41 +0,0 @@
-TARGET = qtsensors_android
-
-QT = sensors core-private
-
-# STATICPLUGIN needed because there's a Q_IMPORT_PLUGIN in main.cpp
-# Yes, the plugin imports itself statically
-DEFINES += QT_STATICPLUGIN
-
-HEADERS = \
- androidaccelerometer.h \
- androidcompass.h \
- androidgyroscope.h \
- androidmagnetometer.h \
- androidpressure.h \
- androidproximity.h \
- androidrotation.h \
- androidtemperature.h \
- androidlight.h \
- sensoreventqueue.h \
- sensormanager.h
-
-SOURCES = \
- main.cpp \
- androidaccelerometer.cpp \
- androidcompass.cpp \
- androidgyroscope.cpp \
- androidmagnetometer.cpp \
- androidpressure.cpp \
- androidproximity.cpp \
- androidrotation.cpp \
- androidtemperature.cpp \
- androidlight.cpp \
- sensormanager.cpp
-
-OTHER_FILES = plugin.json
-
-LIBS += -landroid
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = QCounterGesturePlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/dummy/CMakeLists.txt b/src/plugins/sensors/dummy/CMakeLists.txt
new file mode 100644
index 00000000..ad245350
--- /dev/null
+++ b/src/plugins/sensors/dummy/CMakeLists.txt
@@ -0,0 +1,27 @@
+#####################################################################
+## dummySensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(dummySensorPlugin
+ OUTPUT_NAME qtsensors_dummy
+ TYPE sensors
+ SOURCES
+ dummyaccelerometer.cpp dummyaccelerometer.h
+ dummycommon.cpp dummycommon.h
+ dummylightsensor.cpp dummylightsensor.h
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Sensors
+)
+
+#### Keys ignored in scope 1:.:.:dummy.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(dummySensorPlugin CONDITION UNIX AND NOT ANDROID AND NOT APPLE AND NOT OPENBSD AND NOT QNX
+ PUBLIC_LIBRARIES
+ rt
+)
diff --git a/src/plugins/sensors/dummy/dummy.pro b/src/plugins/sensors/dummy/dummy.pro
deleted file mode 100644
index 6eab4912..00000000
--- a/src/plugins/sensors/dummy/dummy.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TARGET = qtsensors_dummy
-QT = sensors core
-
-HEADERS += dummycommon.h\
- dummyaccelerometer.h\
- dummylightsensor.h
-
-SOURCES += dummycommon.cpp\
- dummyaccelerometer.cpp\
- dummylightsensor.cpp\
- main.cpp
-
-OTHER_FILES = plugin.json
-
-unix:!darwin:!qnx:!android:!openbsd: LIBS += -lrt
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = dummySensorPlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/generic/CMakeLists.txt b/src/plugins/sensors/generic/CMakeLists.txt
new file mode 100644
index 00000000..ccdbe811
--- /dev/null
+++ b/src/plugins/sensors/generic/CMakeLists.txt
@@ -0,0 +1,33 @@
+#####################################################################
+## genericSensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(genericSensorPlugin
+ OUTPUT_NAME qtsensors_generic
+ TYPE sensors
+ SOURCES
+ genericalssensor.cpp genericalssensor.h
+ genericorientationsensor.cpp genericorientationsensor.h
+ generictiltsensor.cpp generictiltsensor.h
+ main.cpp
+ DEFINES
+ QTSENSORS_GENERICALSSENSOR
+ QTSENSORS_GENERICORIENTATIONSENSOR
+ QTSENSORS_GENERICTILTSENSOR
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Sensors
+)
+
+#### Keys ignored in scope 1:.:.:generic.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(genericSensorPlugin CONDITION NOT ANDROID
+ SOURCES
+ genericrotationsensor.cpp genericrotationsensor.h
+ DEFINES
+ QTSENSORS_GENERICROTATIONSENSOR
+)
diff --git a/src/plugins/sensors/generic/generic.pro b/src/plugins/sensors/generic/generic.pro
deleted file mode 100644
index cf87ccf3..00000000
--- a/src/plugins/sensors/generic/generic.pro
+++ /dev/null
@@ -1,29 +0,0 @@
-TARGET = qtsensors_generic
-QT = core sensors
-
-HEADERS += generictiltsensor.h
-
-SOURCES += main.cpp\
- generictiltsensor.cpp
-DEFINES += QTSENSORS_GENERICTILTSENSOR
-
-HEADERS += genericorientationsensor.h\
- genericalssensor.h
-
-SOURCES += genericorientationsensor.cpp\
- genericalssensor.cpp
-DEFINES += QTSENSORS_GENERICORIENTATIONSENSOR QTSENSORS_GENERICALSSENSOR
-
-!android {
- HEADERS += genericrotationsensor.h
-
- SOURCES += genericrotationsensor.cpp
-
- DEFINES += QTSENSORS_GENERICROTATIONSENSOR
-}
-
-OTHER_FILES = plugin.json
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = genericSensorPlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/iio-sensor-proxy/CMakeLists.txt b/src/plugins/sensors/iio-sensor-proxy/CMakeLists.txt
new file mode 100644
index 00000000..2a593e90
--- /dev/null
+++ b/src/plugins/sensors/iio-sensor-proxy/CMakeLists.txt
@@ -0,0 +1,41 @@
+#####################################################################
+## IIOSensorProxySensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(IIOSensorProxySensorPlugin
+ OUTPUT_NAME qtsensors_iio-sensor-proxy
+ TYPE sensors
+ SOURCES
+ iiosensorproxycompass.cpp iiosensorproxycompass.h
+ iiosensorproxylightsensor.cpp iiosensorproxylightsensor.h
+ iiosensorproxyorientationsensor.cpp iiosensorproxyorientationsensor.h
+ iiosensorproxysensorbase.cpp iiosensorproxysensorbase.h
+ main.cpp
+ DBUS_INTERFACE_SOURCES
+ org.freedesktop.DBus.Properties.xml
+ net.hadess.SensorProxy.xml
+ net.hadess.SensorProxy.Compass.xml
+ DBUS_INTERFACE_FLAGS
+ "-N"
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::DBus
+ Qt::Sensors
+)
+
+#### Keys ignored in scope 1:.:.:iio-sensor-proxy.pro:<TRUE>:
+# OTHER_FILES = "plugin.json" "$$DBUS_INTERFACES"
+# dbus_properties.files = "org.freedesktop.DBus.Properties.xml"
+# dbus_properties.header_flags = "-N"
+# sensor_proxy.files = "net.hadess.SensorProxy.xml"
+# sensor_proxy.header_flags = "-N"
+# sensor_proxy_compass.files = "net.hadess.SensorProxy.Compass.xml"
+# sensor_proxy_compass.header_flags = "-N"
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(IIOSensorProxySensorPlugin CONDITION NOT ANDROID
+ PUBLIC_LIBRARIES
+ rt
+)
diff --git a/src/plugins/sensors/iio-sensor-proxy/iio-sensor-proxy.pro b/src/plugins/sensors/iio-sensor-proxy/iio-sensor-proxy.pro
deleted file mode 100644
index b68d9fbf..00000000
--- a/src/plugins/sensors/iio-sensor-proxy/iio-sensor-proxy.pro
+++ /dev/null
@@ -1,31 +0,0 @@
-TARGET = qtsensors_iio-sensor-proxy
-QT = core dbus sensors
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = IIOSensorProxySensorPlugin
-load(qt_plugin)
-
-!android:LIBS += -lrt
-HEADERS += iiosensorproxysensorbase.h \
- iiosensorproxylightsensor.h \
- iiosensorproxyorientationsensor.h \
- iiosensorproxycompass.h
-
-SOURCES += iiosensorproxysensorbase.cpp \
- iiosensorproxylightsensor.cpp \
- iiosensorproxyorientationsensor.cpp \
- iiosensorproxycompass.cpp \
- main.cpp
-
-DBUS_INTERFACES += sensor_proxy sensor_proxy_compass dbus_properties
-
-sensor_proxy.files = net.hadess.SensorProxy.xml
-sensor_proxy.header_flags = -N
-
-sensor_proxy_compass.files = net.hadess.SensorProxy.Compass.xml
-sensor_proxy_compass.header_flags = -N
-
-dbus_properties.files = org.freedesktop.DBus.Properties.xml
-dbus_properties.header_flags = -N
-
-OTHER_FILES = plugin.json $$DBUS_INTERFACES
diff --git a/src/plugins/sensors/ios/CMakeLists.txt b/src/plugins/sensors/ios/CMakeLists.txt
new file mode 100644
index 00000000..9a6b100c
--- /dev/null
+++ b/src/plugins/sensors/ios/CMakeLists.txt
@@ -0,0 +1,50 @@
+#####################################################################
+## IOSSensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(IOSSensorPlugin
+ OUTPUT_NAME qtsensors_ios
+ TYPE sensors
+ SOURCES
+ main.mm
+ PUBLIC_LIBRARIES
+ ${FWFoundation}
+ Qt::Core
+ Qt::Sensors
+)
+
+#### Keys ignored in scope 1:.:.:ios.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(IOSSensorPlugin CONDITION IOS AND UIKIT
+ SOURCES
+ ioscompass.h ioscompass.mm
+ DEFINES
+ HAVE_COMPASS
+ PUBLIC_LIBRARIES
+ ${FWCoreLocation}
+)
+
+qt_internal_extend_target(IOSSensorPlugin CONDITION UIKIT AND NOT TVOS
+ SOURCES
+ iosaccelerometer.h iosaccelerometer.mm
+ iosgyroscope.h iosgyroscope.mm
+ iosmagnetometer.h iosmagnetometer.mm
+ iosmotionmanager.h iosmotionmanager.mm
+ DEFINES
+ HAVE_COREMOTION
+ PUBLIC_LIBRARIES
+ ${FWCoreMotion}
+)
+
+qt_internal_extend_target(IOSSensorPlugin CONDITION UIKIT AND NOT WATCHOS
+ SOURCES
+ iosproximitysensor.h iosproximitysensor.mm
+ DEFINES
+ HAVE_UIDEVICE
+ PUBLIC_LIBRARIES
+ ${FWUIKit}
+)
diff --git a/src/plugins/sensors/ios/ios.pro b/src/plugins/sensors/ios/ios.pro
deleted file mode 100644
index 91ec3ae0..00000000
--- a/src/plugins/sensors/ios/ios.pro
+++ /dev/null
@@ -1,49 +0,0 @@
-TARGET = qtsensors_ios
-QT = core sensors
-
-OTHER_FILES = plugin.json
-
-OBJECTIVE_SOURCES += main.mm
-LIBS += -framework Foundation
-
-uikit {
- ios {
- HEADERS += \
- ioscompass.h
- OBJECTIVE_SOURCES += \
- ioscompass.mm
-
- DEFINES += HAVE_COMPASS
- LIBS += -framework CoreLocation
- }
-
- !tvos {
- HEADERS += \
- iosaccelerometer.h \
- iosgyroscope.h \
- iosmagnetometer.h \
- iosmotionmanager.h
- OBJECTIVE_SOURCES += \
- iosaccelerometer.mm \
- iosgyroscope.mm \
- iosmagnetometer.mm \
- iosmotionmanager.mm
-
- DEFINES += HAVE_COREMOTION
- LIBS += -framework CoreMotion
- }
-
- !watchos {
- HEADERS += \
- iosproximitysensor.h
- OBJECTIVE_SOURCES += \
- iosproximitysensor.mm
-
- DEFINES += HAVE_UIDEVICE
- LIBS += -framework UIKit
- }
-}
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = IOSSensorPlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/linux/CMakeLists.txt b/src/plugins/sensors/linux/CMakeLists.txt
new file mode 100644
index 00000000..aa3950ad
--- /dev/null
+++ b/src/plugins/sensors/linux/CMakeLists.txt
@@ -0,0 +1,25 @@
+#####################################################################
+## LinuxSensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(LinuxSensorPlugin
+ OUTPUT_NAME qtsensors_linuxsys
+ TYPE sensors
+ SOURCES
+ linuxsysaccelerometer.cpp linuxsysaccelerometer.h
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Sensors
+)
+
+#### Keys ignored in scope 1:.:.:linux.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(LinuxSensorPlugin CONDITION NOT ANDROID
+ PUBLIC_LIBRARIES
+ rt
+)
diff --git a/src/plugins/sensors/linux/linux.pro b/src/plugins/sensors/linux/linux.pro
deleted file mode 100644
index 33706e7d..00000000
--- a/src/plugins/sensors/linux/linux.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TARGET = qtsensors_linuxsys
-QT = core sensors
-
-OTHER_FILES = plugin.json
-
-!android:LIBS += -lrt
-HEADERS += linuxsysaccelerometer.h
-SOURCES += linuxsysaccelerometer.cpp \
-main.cpp
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = LinuxSensorPlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/sensorfw/CMakeLists.txt b/src/plugins/sensors/sensorfw/CMakeLists.txt
new file mode 100644
index 00000000..9b4dceca
--- /dev/null
+++ b/src/plugins/sensors/sensorfw/CMakeLists.txt
@@ -0,0 +1,36 @@
+#####################################################################
+## sensorfwSensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(sensorfwSensorPlugin
+ OUTPUT_NAME qtsensors_sensorfw
+ TYPE sensors
+ SOURCES
+ main.cpp
+ sensorfwaccelerometer.cpp sensorfwaccelerometer.h
+ sensorfwals.cpp sensorfwals.h
+ sensorfwcompass.cpp sensorfwcompass.h
+ sensorfwgyroscope.cpp sensorfwgyroscope.h
+ sensorfwirproximitysensor.cpp sensorfwirproximitysensor.h
+ sensorfwlidsensor.cpp sensorfwlidsensor.h
+ sensorfwlightsensor.cpp sensorfwlightsensor.h
+ sensorfwmagnetometer.cpp sensorfwmagnetometer.h
+ sensorfworientationsensor.cpp sensorfworientationsensor.h
+ sensorfwproximitysensor.cpp sensorfwproximitysensor.h
+ sensorfwrotationsensor.cpp sensorfwrotationsensor.h
+ sensorfwsensorbase.cpp sensorfwsensorbase.h
+ sensorfwtapsensor.cpp sensorfwtapsensor.h
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::DBus
+ Qt::Network
+ LIBRARIES
+ Qt::SensorsPrivate
+ sensorfw
+)
+
+#### Keys ignored in scope 1:.:.:sensorfw.pro:<TRUE>:
+# CONFIGFILES.files = "Sensors.conf"
+# CONFIGFILES.path = "/etc/xdg/QtProject/"
+# INSTALLS = "CONFIGFILES"
+# OTHER_FILES = "plugin.json"
diff --git a/src/plugins/sensors/sensorfw/sensorfw.pro b/src/plugins/sensors/sensorfw/sensorfw.pro
deleted file mode 100644
index 63a66117..00000000
--- a/src/plugins/sensors/sensorfw/sensorfw.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TARGET = qtsensors_sensorfw
-QT = core sensors-private network dbus
-
-include(sensorfw.pri)
-
-QMAKE_USE += sensorfw
-
-CONFIGFILES.files = Sensors.conf
-CONFIGFILES.path = /etc/xdg/QtProject/
-INSTALLS += CONFIGFILES
-
-OTHER_FILES = plugin.json
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = sensorfwSensorPlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/sensorfw/sensorfwsensorbase.h b/src/plugins/sensors/sensorfw/sensorfwsensorbase.h
index 7e7f5c33..308265fb 100644
--- a/src/plugins/sensors/sensorfw/sensorfwsensorbase.h
+++ b/src/plugins/sensors/sensorfw/sensorfwsensorbase.h
@@ -101,7 +101,7 @@ protected:
int bufferSize() const;
virtual qreal correctionFactor() const;
bool reinitIsNeeded;
- bool isFeatureSupported(QSensor::Feature feature) const;
+ bool isFeatureSupported(QSensor::Feature feature) const override;
private:
bool initSensorInterface(QString const &);
diff --git a/src/plugins/sensors/sensors.pro b/src/plugins/sensors/sensors.pro
deleted file mode 100644
index c637e6ac..00000000
--- a/src/plugins/sensors/sensors.pro
+++ /dev/null
@@ -1,45 +0,0 @@
-TEMPLATE = subdirs
-QT_FOR_CONFIG += sensors-private
-
-android {
- isEmpty(SENSORS_PLUGINS): SENSORS_PLUGINS = android generic
-}
-
-qtConfig(sensorfw) {
- isEmpty(SENSORS_PLUGINS): SENSORS_PLUGINS = sensorfw generic
-}
-
-darwin {
- isEmpty(SENSORS_PLUGINS): SENSORS_PLUGINS = ios generic
-}
-
-win32 {
- isEmpty(SENSORS_PLUGINS): SENSORS_PLUGINS = winrt generic
-}
-
-qtHaveModule(simulator) {
- isEmpty(SENSORS_PLUGINS): SENSORS_PLUGINS = simulator generic
-}
-
-linux {
- isEmpty(SENSORS_PLUGINS): SENSORS_PLUGINS = linux iio-sensor-proxy generic
-}
-
-contains(CONFIG, sensortag) {
- qtHaveModule(bluetooth) {
- SENSORS_PLUGINS = sensortag generic
- } else {
- message("You have configured for sensortag, but Qt Bluetooth module was not found.")
- }
-}
-
-contains(SENSORS_PLUGINS, dummy):SUBDIRS += dummy
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, generic):SUBDIRS += generic
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, simulator):qtHaveModule(simulator):SUBDIRS += simulator
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, linux):linux:SUBDIRS += linux
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, iio-sensor-proxy):linux:qtHaveModule(dbus):SUBDIRS += iio-sensor-proxy
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, android):android:SUBDIRS += android
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, sensorfw):sensorfw:SUBDIRS += sensorfw
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, sensortag):linux:SUBDIRS += sensortag
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, ios):darwin:SUBDIRS += ios
-isEmpty(SENSORS_PLUGINS)|contains(SENSORS_PLUGINS, winrt):SUBDIRS += winrt
diff --git a/src/plugins/sensors/sensortag/CMakeLists.txt b/src/plugins/sensors/sensortag/CMakeLists.txt
new file mode 100644
index 00000000..4f70d76c
--- /dev/null
+++ b/src/plugins/sensors/sensortag/CMakeLists.txt
@@ -0,0 +1,26 @@
+#####################################################################
+## SensortagSensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(SensortagSensorPlugin
+ OUTPUT_NAME qtsensors_sensortag
+ TYPE sensors
+ SOURCES
+ main.cpp
+ sensortagaccelerometer.cpp sensortagaccelerometer.h
+ sensortagals.cpp sensortagals.h
+ sensortagbase.cpp sensortagbase.h
+ sensortaggyroscope.cpp sensortaggyroscope.h
+ sensortaghumiditysensor.cpp sensortaghumiditysensor.h
+ sensortaglightsensor.cpp sensortaglightsensor.h
+ sensortagmagnetometer.cpp sensortagmagnetometer.h
+ sensortagpressuresensor.cpp sensortagpressuresensor.h
+ sensortagtemperaturesensor.cpp sensortagtemperaturesensor.h
+ PUBLIC_LIBRARIES
+ Qt::Bluetooth
+ Qt::Core
+ Qt::SensorsPrivate
+)
+
+#### Keys ignored in scope 1:.:.:sensortag.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
diff --git a/src/plugins/sensors/sensortag/sensortag.pro b/src/plugins/sensors/sensortag/sensortag.pro
deleted file mode 100644
index 42252970..00000000
--- a/src/plugins/sensors/sensortag/sensortag.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = qtsensors_sensortag
-QT = core sensors-private bluetooth
-CONFIG += c++11
-
-include(sensortag.pri)
-
-OTHER_FILES = plugin.json
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = SensortagSensorPlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/simulator/main.cpp b/src/plugins/sensors/simulator/main.cpp
deleted file mode 100644
index 167711a9..00000000
--- a/src/plugins/sensors/simulator/main.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatoraccelerometer.h"
-#include "simulatorambientlightsensor.h"
-#include "simulatorlightsensor.h"
-#include "simulatorcompass.h"
-#include "simulatorproximitysensor.h"
-#include "simulatorirproximitysensor.h"
-#include "simulatormagnetometer.h"
-#include <QSensorPluginInterface>
-#include <QSensorBackend>
-#include <QSensorManager>
-
-class SimulatorSensorPlugin : public QObject, public QSensorPluginInterface, public QSensorBackendFactory
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "com.qt-project.Qt.QSensorPluginInterface/1.0" FILE "plugin.json")
- Q_INTERFACES(QSensorPluginInterface)
-public:
- SimulatorSensorPlugin()
- {
- SensorsConnection *connection = SensorsConnection::instance();
- if (!connection) return; // hardly likely but just in case...
- connect(connection, SIGNAL(setAvailableFeatures(quint32)), this, SLOT(setAvailableFeatures(quint32)));
- }
-
- void registerSensors() override
- {
- QSensorManager::registerBackend(QAccelerometer::type, SimulatorAccelerometer::id, this);
- QSensorManager::registerBackend(QAmbientLightSensor::type, SimulatorAmbientLightSensor::id, this);
- QSensorManager::registerBackend(QLightSensor::type, SimulatorLightSensor::id, this);
- QSensorManager::registerBackend(QCompass::type, SimulatorCompass::id, this);
- QSensorManager::registerBackend(QProximitySensor::type, SimulatorProximitySensor::id, this);
- QSensorManager::registerBackend(QIRProximitySensor::type, SimulatorIRProximitySensor::id, this);
- QSensorManager::registerBackend(QMagnetometer::type, SimulatorMagnetometer::id, this);
- }
-
- QSensorBackend *createBackend(QSensor *sensor) override
- {
- if (sensor->identifier() == SimulatorAccelerometer::id) {
- return new SimulatorAccelerometer(sensor);
- }
-
- if (sensor->identifier() == SimulatorAmbientLightSensor::id) {
- return new SimulatorAmbientLightSensor(sensor);
- }
-
- if (sensor->identifier() == SimulatorLightSensor::id) {
- return new SimulatorLightSensor(sensor);
- }
-
- if (sensor->identifier() == SimulatorProximitySensor::id) {
- return new SimulatorProximitySensor(sensor);
- }
-
- if (sensor->identifier() == SimulatorIRProximitySensor::id) {
- return new SimulatorIRProximitySensor(sensor);
- }
-
- if (sensor->identifier() == SimulatorCompass::id) {
- return new SimulatorCompass(sensor);
- }
-
- if (sensor->identifier() == SimulatorMagnetometer::id) {
- return new SimulatorMagnetometer(sensor);
- }
-
- return 0;
- }
-
- // Copied from the emulator codebase
- enum Features {
- Accelerometer = 0x01,
- Magnetometer = 0x02,
- Compass = 0x04,
- Infraredsensor = 0x08,
- Lightsensor = 0x10
- };
-
-public slots:
- void setAvailableFeatures(quint32 features)
- {
- check(features&Accelerometer, QAccelerometer::type, SimulatorAccelerometer::id);
- check(features&Lightsensor, QLightSensor::type, SimulatorLightSensor::id);
- check(features&Lightsensor, QAmbientLightSensor::type, SimulatorAmbientLightSensor::id);
- check(features&Magnetometer, QMagnetometer::type, SimulatorMagnetometer::id);
- check(features&Compass, QCompass::type, SimulatorCompass::id);
- check(features&Infraredsensor, QIRProximitySensor::type, SimulatorIRProximitySensor::id);
- check(features&Infraredsensor, QProximitySensor::type, SimulatorProximitySensor::id);
- }
-
-private:
- void check(bool test, const QByteArray &type, const QByteArray &id)
- {
- if (test) {
- if (!QSensorManager::isBackendRegistered(type, id))
- QSensorManager::registerBackend(type, id, this);
- } else {
- if (QSensorManager::isBackendRegistered(type, id))
- QSensorManager::unregisterBackend(type, id);
- }
- }
-};
-
-#include "main.moc"
-
diff --git a/src/plugins/sensors/simulator/plugin.json b/src/plugins/sensors/simulator/plugin.json
deleted file mode 100644
index 77f47afe..00000000
--- a/src/plugins/sensors/simulator/plugin.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "Keys": [ "simulator" ] }
diff --git a/src/plugins/sensors/simulator/qsensordata_simulator.cpp b/src/plugins/sensors/simulator/qsensordata_simulator.cpp
deleted file mode 100644
index 3e590d66..00000000
--- a/src/plugins/sensors/simulator/qsensordata_simulator.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "qsensordata_simulator_p.h"
-
-#include <QtCore/QDataStream>
-
-namespace QtMobility {
-
-void qt_registerSensorTypes()
-{
- qRegisterMetaTypeStreamOperators<QAmbientLightReadingData>("QtMobility::QAmbientLightReadingData");
- qRegisterMetaTypeStreamOperators<QLightReadingData>("QtMobility::QLightReadingData");
- qRegisterMetaTypeStreamOperators<QAccelerometerReadingData>("QtMobility::QAccelerometerReadingData");
- qRegisterMetaTypeStreamOperators<QCompassReadingData>("QtMobility::QCompassReadingData");
- qRegisterMetaTypeStreamOperators<QProximityReadingData>("QtMobility::QProximityReadingData");
- qRegisterMetaTypeStreamOperators<QIRProximityReadingData>("QtMobility::QIRProximityReadingData");
- qRegisterMetaTypeStreamOperators<QMagnetometerReadingData>("QtMobility::QMagnetometerReadingData");
-}
-
-QDataStream &operator<<(QDataStream &out, const QAmbientLightReadingData &s)
-{
- out << static_cast<qint32>(s.lightLevel) << s.timestamp;
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, QAmbientLightReadingData &s)
-{
- qint32 lightLevel;
- in >> lightLevel >> s.timestamp;
- s.lightLevel = static_cast<SimulatorLightLevel>(lightLevel);
- return in;
-}
-
-QDataStream &operator<<(QDataStream &out, const QLightReadingData &s)
-{
- out << s.lux << s.timestamp;
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, QLightReadingData &s)
-{
- in >> s.lux >> s.timestamp;
- return in;
-}
-
-QDataStream &operator<<(QDataStream &out, const QAccelerometerReadingData &s)
-{
- out << s.x << s.y << s.z << s.timestamp;
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, QAccelerometerReadingData &s)
-{
- in >> s.x >> s.y >> s.z >> s.timestamp;
- return in;
-}
-
-QDataStream &operator<<(QDataStream &out, const QCompassReadingData &s)
-{
- out << s.azimuth << s.calibrationLevel << s.timestamp;
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, QCompassReadingData &s)
-{
- in >> s.azimuth >> s.calibrationLevel >> s.timestamp;
- return in;
-}
-
-QDataStream &operator<<(QDataStream &out, const QProximityReadingData &s)
-{
- out << s.close << s.timestamp;
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, QProximityReadingData &s)
-{
- in >> s.close >> s.timestamp;
- return in;
-}
-
-QDataStream &operator<<(QDataStream &out, const QIRProximityReadingData &s)
-{
- out << s.irProximity << s.timestamp;
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, QIRProximityReadingData &s)
-{
- in >> s.irProximity >> s.timestamp;
- return in;
-}
-
-QDataStream &operator<<(QDataStream &out, const QMagnetometerReadingData &s)
-{
- out << s.x << s.y << s.z << s.calibrationLevel << s.timestamp;
- return out;
-}
-
-QDataStream &operator>>(QDataStream &in, QMagnetometerReadingData &s)
-{
- in >> s.x >> s.y >> s.z >> s.calibrationLevel >> s.timestamp;
- return in;
-}
-
-} // namespace
diff --git a/src/plugins/sensors/simulator/qsensordata_simulator_p.h b/src/plugins/sensors/simulator/qsensordata_simulator_p.h
deleted file mode 100644
index 410078d8..00000000
--- a/src/plugins/sensors/simulator/qsensordata_simulator_p.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 QSENSORDATA_SIMULATOR_P_H
-#define QSENSORDATA_SIMULATOR_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/QMetaType>
-#include <QtCore/QDateTime>
-
-namespace QtMobility {
-
-enum SimulatorLightLevel {
- Undefined = 0,
- Dark,
- Twilight,
- Light,
- Bright,
- Sunny
-};
-
-struct QAmbientLightReadingData
-{
- SimulatorLightLevel lightLevel;
- QDateTime timestamp;
-};
-
-struct QLightReadingData
-{
- double lux;
- QDateTime timestamp;
-};
-
-struct QAccelerometerReadingData
-{
- double x;
- double y;
- double z;
- QDateTime timestamp;
-};
-
-struct QMagnetometerReadingData
-{
- double x;
- double y;
- double z;
- double calibrationLevel;
- QDateTime timestamp;
-};
-
-struct QCompassReadingData
-{
- double azimuth;
- double calibrationLevel;
- QDateTime timestamp;
-};
-
-struct QProximityReadingData
-{
- bool close;
- QDateTime timestamp;
-};
-
-struct QIRProximityReadingData
-{
- double irProximity;
- QDateTime timestamp;
-};
-
-void qt_registerSensorTypes();
-
-}
-
-Q_DECLARE_METATYPE(QtMobility::QAmbientLightReadingData)
-Q_DECLARE_METATYPE(QtMobility::QLightReadingData)
-Q_DECLARE_METATYPE(QtMobility::QAccelerometerReadingData)
-Q_DECLARE_METATYPE(QtMobility::QMagnetometerReadingData)
-Q_DECLARE_METATYPE(QtMobility::QCompassReadingData)
-Q_DECLARE_METATYPE(QtMobility::QProximityReadingData)
-Q_DECLARE_METATYPE(QtMobility::QIRProximityReadingData)
-
-#endif // QSENSORDATA_SIMULATOR_P_H
diff --git a/src/plugins/sensors/simulator/simulator.pro b/src/plugins/sensors/simulator/simulator.pro
deleted file mode 100644
index ac8ea506..00000000
--- a/src/plugins/sensors/simulator/simulator.pro
+++ /dev/null
@@ -1,32 +0,0 @@
-TARGET = qtsensors_simulator
-
-QT=core gui network sensors simulator
-
-HEADERS += \
- simulatorcommon.h\
- simulatoraccelerometer.h\
- simulatorambientlightsensor.h\
- simulatorlightsensor.h\
- simulatorcompass.h\
- simulatorproximitysensor.h\
- simulatorirproximitysensor.h\
- simulatormagnetometer.h\
- qsensordata_simulator_p.h
-
-SOURCES += \
- simulatorcommon.cpp\
- simulatoraccelerometer.cpp\
- simulatorambientlightsensor.cpp\
- simulatorlightsensor.cpp\
- simulatorcompass.cpp\
- simulatorproximitysensor.cpp\
- simulatorirproximitysensor.cpp\
- simulatormagnetometer.cpp\
- qsensordata_simulator.cpp\
- main.cpp
-
-OTHER_FILES = plugin.json
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = SimulatorSensorPlugin
-load(qt_plugin)
diff --git a/src/plugins/sensors/simulator/simulatoraccelerometer.cpp b/src/plugins/sensors/simulator/simulatoraccelerometer.cpp
deleted file mode 100644
index 280fc7ee..00000000
--- a/src/plugins/sensors/simulator/simulatoraccelerometer.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatoraccelerometer.h"
-#include <QDebug>
-#include <QtGlobal>
-
-const char *SimulatorAccelerometer::id("Simulator.Accelerometer");
-
-SimulatorAccelerometer::SimulatorAccelerometer(QSensor *sensor)
- : SimulatorCommon(sensor)
-{
- setReading<QAccelerometerReading>(&m_reading);
-}
-
-void SimulatorAccelerometer::poll()
-{
- QtMobility::QAccelerometerReadingData data = SensorsConnection::instance()->qtAccelerometerData;
- quint64 newTimestamp;
- if (!data.timestamp.isValid())
- newTimestamp = static_cast<quint64>(QDateTime::currentMSecsSinceEpoch()) / 1000;
- else
- newTimestamp = static_cast<quint64>(data.timestamp.toSecsSinceEpoch());
- if (m_reading.x() != data.x
- || m_reading.y() != data.y
- || m_reading.z() != data.z) {
- m_reading.setTimestamp(newTimestamp);
- m_reading.setX(data.x);
- m_reading.setY(data.y);
- m_reading.setZ(data.z);
-
- newReadingAvailable();
- }
-}
-
diff --git a/src/plugins/sensors/simulator/simulatoraccelerometer.h b/src/plugins/sensors/simulator/simulatoraccelerometer.h
deleted file mode 100644
index a4205867..00000000
--- a/src/plugins/sensors/simulator/simulatoraccelerometer.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORACCELEROMETER_H
-#define SIMULATORACCELEROMETER_H
-
-#include "simulatorcommon.h"
-#include <qaccelerometer.h>
-
-class SimulatorAccelerometer : public SimulatorCommon
-{
-public:
- static const char *id;
-
- SimulatorAccelerometer(QSensor *sensor);
-
- void poll() override;
-private:
- QAccelerometerReading m_reading;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/simulator/simulatorambientlightsensor.cpp b/src/plugins/sensors/simulator/simulatorambientlightsensor.cpp
deleted file mode 100644
index 5d84b36c..00000000
--- a/src/plugins/sensors/simulator/simulatorambientlightsensor.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatorambientlightsensor.h"
-#include <QDebug>
-#include <QtGlobal>
-
-const char *SimulatorAmbientLightSensor::id("Simulator.AmbientLightSensor");
-
-SimulatorAmbientLightSensor::SimulatorAmbientLightSensor(QSensor *sensor)
- : SimulatorCommon(sensor)
-{
- setReading<QAmbientLightReading>(&m_reading);
-}
-
-void SimulatorAmbientLightSensor::poll()
-{
- QtMobility::QAmbientLightReadingData data = SensorsConnection::instance()->qtAmbientLightData;
- QAmbientLightReading::LightLevel convertedLightLevel;
- switch (data.lightLevel) {
- case QtMobility::Dark:
- convertedLightLevel = QAmbientLightReading::Dark;
- break;
- case QtMobility::Twilight:
- convertedLightLevel = QAmbientLightReading::Twilight;
- break;
- case QtMobility::Light:
- convertedLightLevel = QAmbientLightReading::Light;
- break;
- case QtMobility::Bright:
- convertedLightLevel = QAmbientLightReading::Bright;
- break;
- case QtMobility::Sunny:
- convertedLightLevel = QAmbientLightReading::Sunny;
- break;
- default:
- convertedLightLevel = QAmbientLightReading::Undefined;
- break;
- }
-
- quint64 newTimestamp;
- if (!data.timestamp.isValid())
- newTimestamp = static_cast<quint64>(QDateTime::currentMSecsSinceEpoch()) / 1000;
- else
- newTimestamp = static_cast<quint64>(data.timestamp.toSecsSinceEpoch());
- if (m_reading.lightLevel() != convertedLightLevel) {
- m_reading.setTimestamp(newTimestamp);
- m_reading.setLightLevel(convertedLightLevel);
-
- newReadingAvailable();
- }
-}
-
diff --git a/src/plugins/sensors/simulator/simulatorambientlightsensor.h b/src/plugins/sensors/simulator/simulatorambientlightsensor.h
deleted file mode 100644
index 0aadffe6..00000000
--- a/src/plugins/sensors/simulator/simulatorambientlightsensor.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORAMBIENTLIGHTSENSOR_H
-#define SIMULATORAMBIENTLIGHTSENSOR_H
-
-#include "simulatorcommon.h"
-#include <qambientlightsensor.h>
-
-class SimulatorAmbientLightSensor : public SimulatorCommon
-{
-public:
- static const char *id;
-
- SimulatorAmbientLightSensor(QSensor *sensor);
-
- void poll() override;
-private:
- QAmbientLightReading m_reading;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/simulator/simulatorcommon.cpp b/src/plugins/sensors/simulator/simulatorcommon.cpp
deleted file mode 100644
index a1693364..00000000
--- a/src/plugins/sensors/simulator/simulatorcommon.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatorcommon.h"
-#include "qsensordata_simulator_p.h"
-#include <QtSimulator/QtSimulator>
-#include <QDebug>
-#include <QThread>
-
-using namespace Simulator;
-
-Q_GLOBAL_STATIC(SensorsConnection, sensorsConnection)
-
-class SimulatorAsyncConnection: public QThread
-{
- Q_OBJECT
-public:
- SimulatorAsyncConnection()
- : QThread()
- {
- QtMobility::qt_registerSensorTypes();
-
- moveToThread(this);
- connect(this, SIGNAL(queueConnectToServer()),
- this, SLOT(doConnectToServer()),
- Qt::QueuedConnection);
-
- start();
- }
-
- ~SimulatorAsyncConnection()
- {
- quit();
- wait();
- }
-
- void connectToServer()
- {
- emit queueConnectToServer();
- }
-
-signals:
- void queueConnectToServer();
-
- void initialSensorsDataSent();
- void connectionFailed();
- void setAvailableFeatures(quint32 features);
- void setAmbientLightData(const QtMobility::QAmbientLightReadingData &);
- void setLightData(const QtMobility::QLightReadingData &);
- void setAccelerometerData(const QtMobility::QAccelerometerReadingData &);
- void setMagnetometerData(const QtMobility::QMagnetometerReadingData &);
- void setCompassData(const QtMobility::QCompassReadingData &);
- void setProximityData(const QtMobility::QProximityReadingData &);
- void setIRProximityData(const QtMobility::QIRProximityReadingData &);
-
-private slots:
- void doConnectToServer()
- {
- mConnection.reset(new Connection(Connection::Client, "QtSimulator_Mobility_ServerName1.3.0.0",
- 0xbeef+1, Version(1,0,0,0), this));
- mWorker.reset(mConnection->connectToServer(Connection::simulatorHostName(true), 0xbeef+1));
- if (!mWorker) {
- qWarning("QtSensors simulator backend could not connect to the simulator!");
- emit connectionFailed();
- return;
- }
- mWorker->addReceiver(this);
- mWorker->call("setRequestsSensors");
- }
-
-private:
- QScopedPointer<Simulator::Connection> mConnection;
- QScopedPointer<Simulator::ConnectionWorker> mWorker;
-};
-
-SensorsConnection::SensorsConnection(QObject *parent)
- : QObject(parent)
- , mInitialDataSent(false)
- , mConnectionFailed(false)
-{
- mConnection = new SimulatorAsyncConnection();
-
- connect(mConnection, SIGNAL(initialSensorsDataSent()),
- this, SLOT(initialSensorsDataSent()));
- connect(mConnection, SIGNAL(connectionFailed()),
- this, SLOT(slotConnectionFailed()));
- connect(mConnection, SIGNAL(setAvailableFeatures(quint32)),
- this, SIGNAL(setAvailableFeatures(quint32)));
- connect(mConnection, SIGNAL(setAmbientLightData(QtMobility::QAmbientLightReadingData)),
- this, SLOT(setAmbientLightData(QtMobility::QAmbientLightReadingData)));
- connect(mConnection, SIGNAL(setLightData(QtMobility::QLightReadingData)),
- this, SLOT(setLightData(QtMobility::QLightReadingData)));
- connect(mConnection, SIGNAL(setAccelerometerData(QtMobility::QAccelerometerReadingData)),
- this, SLOT(setAccelerometerData(QtMobility::QAccelerometerReadingData)));
- connect(mConnection, SIGNAL(setMagnetometerData(QtMobility::QMagnetometerReadingData)),
- this, SLOT(setMagnetometerData(QtMobility::QMagnetometerReadingData)));
- connect(mConnection, SIGNAL(setCompassData(QtMobility::QCompassReadingData)),
- this, SLOT(setCompassData(QtMobility::QCompassReadingData)));
- connect(mConnection, SIGNAL(setProximityData(QtMobility::QProximityReadingData)),
- this, SLOT(setProximityData(QtMobility::QProximityReadingData)));
- connect(mConnection, SIGNAL(setIRProximityData(QtMobility::QIRProximityReadingData)),
- this, SLOT(setIRProximityData(QtMobility::QIRProximityReadingData)));
-
- mConnection->connectToServer();
-}
-
-SensorsConnection::~SensorsConnection()
-{
- delete mConnection;
-}
-
-SensorsConnection *SensorsConnection::instance()
-{
- SensorsConnection *connection = sensorsConnection();
- // It's safe to return 0 because this is checked when used
- //if (!connection) qFatal("Cannot return from SensorsConnection::instance because sensorsConnection() returned 0");
- return connection;
-}
-
-void SensorsConnection::setAmbientLightData(const QtMobility::QAmbientLightReadingData &data)
-{
- qtAmbientLightData = data;
-}
-
-void SensorsConnection::setLightData(const QtMobility::QLightReadingData &data)
-{
- qtLightData = data;
-}
-
-void SensorsConnection::setAccelerometerData(const QtMobility::QAccelerometerReadingData &data)
-{
- qtAccelerometerData = data;
-}
-
-void SensorsConnection::setMagnetometerData(const QtMobility::QMagnetometerReadingData &data)
-{
- qtMagnetometerData = data;
-}
-
-void SensorsConnection::setCompassData(const QtMobility::QCompassReadingData &data)
-{
- qtCompassData = data;
-}
-
-void SensorsConnection::setProximityData(const QtMobility::QProximityReadingData &data)
-{
- qtProximityData = data;
-}
-
-void SensorsConnection::setIRProximityData(const QtMobility::QIRProximityReadingData &data)
-{
- qtIRProximityData = data;
-}
-
-void SensorsConnection::initialSensorsDataSent()
-{
- mInitialDataSent = true;
-}
-
-void SensorsConnection::slotConnectionFailed()
-{
- mInitialDataSent = false;
- mConnectionFailed = true;
-}
-
-SimulatorCommon::SimulatorCommon(QSensor *sensor)
- : QSensorBackend(sensor)
- , m_timerid(0)
-{
- addDataRate(1, 100);
- sensor->setDataRate(20);
- (void)SensorsConnection::instance(); // Ensure this exists
-}
-
-void SimulatorCommon::start()
-{
- SensorsConnection *connection = SensorsConnection::instance();
- if (!connection) {
- sensorStopped();
- return;
- }
-
- if (m_timerid)
- return;
-
- int rate = sensor()->dataRate();
- if (rate == 0)
- rate = 20;
- int interval = 1000 / rate;
- if (interval < 0)
- interval = 1000;
-
- if (interval)
- m_timerid = startTimer(interval);
-}
-
-void SimulatorCommon::stop()
-{
- if (m_timerid) {
- killTimer(m_timerid);
- m_timerid = 0;
- }
-}
-
-void SimulatorCommon::timerEvent(QTimerEvent * /*event*/)
-{
- SensorsConnection *connection = SensorsConnection::instance();
- if (!connection || connection->connectionFailed()) {
- stop();
- sensorStopped();
- }
- if (!connection->safe()) return; // wait until it's safe to read the data
- poll();
-}
-
-#include "simulatorcommon.moc"
diff --git a/src/plugins/sensors/simulator/simulatorcommon.h b/src/plugins/sensors/simulator/simulatorcommon.h
deleted file mode 100644
index e47f24d0..00000000
--- a/src/plugins/sensors/simulator/simulatorcommon.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORCOMMON_H
-#define SIMULATORCOMMON_H
-
-#include <qsensorbackend.h>
-#include "qsensordata_simulator_p.h"
-
-class QTimer;
-
-class SimulatorAsyncConnection;
-
-class SensorsConnection : public QObject
-{
- Q_OBJECT
-public:
- explicit SensorsConnection(QObject *parent = 0);
- virtual ~SensorsConnection();
-
- static SensorsConnection *instance();
- bool safe() const { return mInitialDataSent; }
- bool connectionFailed() const { return mConnectionFailed; }
-
-signals:
- void setAvailableFeatures(quint32 features);
-
-public slots:
- void setAmbientLightData(const QtMobility::QAmbientLightReadingData &);
- void setLightData(const QtMobility::QLightReadingData &);
- void setAccelerometerData(const QtMobility::QAccelerometerReadingData &);
- void setMagnetometerData(const QtMobility::QMagnetometerReadingData &);
- void setCompassData(const QtMobility::QCompassReadingData &);
- void setProximityData(const QtMobility::QProximityReadingData &);
- void setIRProximityData(const QtMobility::QIRProximityReadingData &);
- void initialSensorsDataSent();
- void slotConnectionFailed();
-
-private:
- SimulatorAsyncConnection *mConnection;
- bool mInitialDataSent;
- bool mConnectionFailed;
-
-public:
- QtMobility::QAmbientLightReadingData qtAmbientLightData;
- QtMobility::QLightReadingData qtLightData;
- QtMobility::QAccelerometerReadingData qtAccelerometerData;
- QtMobility::QMagnetometerReadingData qtMagnetometerData;
- QtMobility::QCompassReadingData qtCompassData;
- QtMobility::QProximityReadingData qtProximityData;
- QtMobility::QIRProximityReadingData qtIRProximityData;
-};
-
-class SimulatorCommon : public QSensorBackend
-{
-public:
- SimulatorCommon(QSensor *sensor);
-
- void start() override;
- void stop() override;
- virtual void poll() = 0;
- void timerEvent(QTimerEvent * /*event*/) override;
-
-private:
- int m_timerid;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/simulator/simulatorcompass.cpp b/src/plugins/sensors/simulator/simulatorcompass.cpp
deleted file mode 100644
index e9d0f1d7..00000000
--- a/src/plugins/sensors/simulator/simulatorcompass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatorcompass.h"
-#include <QDebug>
-#include <QtGlobal>
-
-const char *SimulatorCompass::id("Simulator.Compass");
-
-SimulatorCompass::SimulatorCompass(QSensor *sensor)
- : SimulatorCommon(sensor)
-{
- setReading<QCompassReading>(&m_reading);
-}
-
-void SimulatorCompass::poll()
-{
- QtMobility::QCompassReadingData data = SensorsConnection::instance()->qtCompassData;
- quint64 newTimestamp;
- if (!data.timestamp.isValid())
- newTimestamp = static_cast<quint64>(QDateTime::currentMSecsSinceEpoch()) / 1000;
- else
- newTimestamp = static_cast<quint64>(data.timestamp.toSecsSinceEpoch());
- if (m_reading.azimuth() != data.azimuth
- || m_reading.calibrationLevel() != data.calibrationLevel) {
- m_reading.setTimestamp(newTimestamp);
- m_reading.setAzimuth(data.azimuth);
- m_reading.setCalibrationLevel(data.calibrationLevel);
-
- newReadingAvailable();
- }
-}
-
diff --git a/src/plugins/sensors/simulator/simulatorcompass.h b/src/plugins/sensors/simulator/simulatorcompass.h
deleted file mode 100644
index 69162c69..00000000
--- a/src/plugins/sensors/simulator/simulatorcompass.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORCOMPASS_H
-#define SIMULATORCOMPASS_H
-
-#include "simulatorcommon.h"
-#include <qcompass.h>
-
-class SimulatorCompass : public SimulatorCommon
-{
-public:
- static const char *id;
-
- SimulatorCompass(QSensor *sensor);
-
- void poll() override;
-private:
- QCompassReading m_reading;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/simulator/simulatorirproximitysensor.cpp b/src/plugins/sensors/simulator/simulatorirproximitysensor.cpp
deleted file mode 100644
index d041a86d..00000000
--- a/src/plugins/sensors/simulator/simulatorirproximitysensor.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatorirproximitysensor.h"
-#include <QDebug>
-#include <QtGlobal>
-
-const char *SimulatorIRProximitySensor::id("Simulator.IRProximitySensor");
-
-SimulatorIRProximitySensor::SimulatorIRProximitySensor(QSensor *sensor)
- : SimulatorCommon(sensor)
-{
- setReading<QIRProximityReading>(&m_reading);
-}
-
-void SimulatorIRProximitySensor::poll()
-{
- QtMobility::QIRProximityReadingData data = SensorsConnection::instance()->qtIRProximityData;
- quint64 newTimestamp;
- if (!data.timestamp.isValid())
- newTimestamp = static_cast<quint64>(QDateTime::currentMSecsSinceEpoch()) / 1000;
- else
- newTimestamp = static_cast<quint64>(data.timestamp.toSecsSinceEpoch());
- if (m_reading.reflectance() != data.irProximity) {
- m_reading.setTimestamp(newTimestamp);
- m_reading.setReflectance(data.irProximity);
-
- newReadingAvailable();
- }
-}
-
diff --git a/src/plugins/sensors/simulator/simulatorirproximitysensor.h b/src/plugins/sensors/simulator/simulatorirproximitysensor.h
deleted file mode 100644
index db20968b..00000000
--- a/src/plugins/sensors/simulator/simulatorirproximitysensor.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORIRPROXIMITYSENSOR_H
-#define SIMULATORIRPROXIMITYSENSOR_H
-
-#include "simulatorcommon.h"
-#include <qirproximitysensor.h>
-
-class SimulatorIRProximitySensor : public SimulatorCommon
-{
-public:
- static const char *id;
-
- SimulatorIRProximitySensor(QSensor *sensor);
-
- void poll() override;
-private:
- QIRProximityReading m_reading;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/simulator/simulatorlightsensor.cpp b/src/plugins/sensors/simulator/simulatorlightsensor.cpp
deleted file mode 100644
index bb4dd94d..00000000
--- a/src/plugins/sensors/simulator/simulatorlightsensor.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatorlightsensor.h"
-#include <QDebug>
-#include <QtGlobal>
-
-const char *SimulatorLightSensor::id("Simulator.LightSensor");
-
-SimulatorLightSensor::SimulatorLightSensor(QSensor *sensor)
- : SimulatorCommon(sensor)
-{
- setReading<QLightReading>(&m_reading);
-}
-
-void SimulatorLightSensor::poll()
-{
- QtMobility::QLightReadingData data = SensorsConnection::instance()->qtLightData;
- quint64 newTimestamp;
- if (!data.timestamp.isValid())
- newTimestamp = static_cast<quint64>(QDateTime::currentMSecsSinceEpoch()) / 1000;
- else
- newTimestamp = static_cast<quint64>(data.timestamp.toSecsSinceEpoch());
- if (m_reading.lux() != data.lux) {
- m_reading.setTimestamp(newTimestamp);
- m_reading.setLux(data.lux);
-
- newReadingAvailable();
- }
-}
-
diff --git a/src/plugins/sensors/simulator/simulatorlightsensor.h b/src/plugins/sensors/simulator/simulatorlightsensor.h
deleted file mode 100644
index 3af3a526..00000000
--- a/src/plugins/sensors/simulator/simulatorlightsensor.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORLIGHTSENSOR_H
-#define SIMULATORLIGHTSENSOR_H
-
-#include "simulatorcommon.h"
-#include <qlightsensor.h>
-
-class SimulatorLightSensor : public SimulatorCommon
-{
-public:
- static const char *id;
-
- SimulatorLightSensor(QSensor *sensor);
-
- void poll() override;
-private:
- QLightReading m_reading;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/simulator/simulatormagnetometer.cpp b/src/plugins/sensors/simulator/simulatormagnetometer.cpp
deleted file mode 100644
index b54525ab..00000000
--- a/src/plugins/sensors/simulator/simulatormagnetometer.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatormagnetometer.h"
-#include <QDebug>
-#include <QtGlobal>
-
-const char *SimulatorMagnetometer::id("Simulator.Magnetometer");
-
-SimulatorMagnetometer::SimulatorMagnetometer(QSensor *sensor)
- : SimulatorCommon(sensor)
-{
- setReading<QMagnetometerReading>(&m_reading);
-}
-
-void SimulatorMagnetometer::poll()
-{
- QtMobility::QMagnetometerReadingData data = SensorsConnection::instance()->qtMagnetometerData;
- quint64 newTimestamp;
- if (!data.timestamp.isValid())
- newTimestamp = static_cast<quint64>(QDateTime::currentMSecsSinceEpoch()) / 1000;
- else
- newTimestamp = static_cast<quint64>(data.timestamp.toSecsSinceEpoch());
- if (m_reading.x() != data.x
- || m_reading.y() != data.y
- || m_reading.z() != data.z
- || m_reading.calibrationLevel() != data.calibrationLevel) {
- m_reading.setTimestamp(newTimestamp);
- m_reading.setX(data.x);
- m_reading.setY(data.y);
- m_reading.setZ(data.z);
- m_reading.setCalibrationLevel(data.calibrationLevel);
-
- newReadingAvailable();
- }
-}
-
diff --git a/src/plugins/sensors/simulator/simulatormagnetometer.h b/src/plugins/sensors/simulator/simulatormagnetometer.h
deleted file mode 100644
index facbad41..00000000
--- a/src/plugins/sensors/simulator/simulatormagnetometer.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORMAGNETOMETER_H
-#define SIMULATORMAGNETOMETER_H
-
-#include "simulatorcommon.h"
-#include <qmagnetometer.h>
-
-class SimulatorMagnetometer : public SimulatorCommon
-{
-public:
- static const char *id;
-
- SimulatorMagnetometer(QSensor *sensor);
-
- void poll() override;
-private:
- QMagnetometerReading m_reading;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/simulator/simulatorproximitysensor.cpp b/src/plugins/sensors/simulator/simulatorproximitysensor.cpp
deleted file mode 100644
index 6a28ce52..00000000
--- a/src/plugins/sensors/simulator/simulatorproximitysensor.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatorproximitysensor.h"
-#include <QDebug>
-#include <QtGlobal>
-
-const char *SimulatorProximitySensor::id("Simulator.ProximitySensor");
-
-SimulatorProximitySensor::SimulatorProximitySensor(QSensor *sensor)
- : SimulatorCommon(sensor)
-{
- setReading<QProximityReading>(&m_reading);
-}
-
-void SimulatorProximitySensor::poll()
-{
- QtMobility::QProximityReadingData data = SensorsConnection::instance()->qtProximityData;
- quint64 newTimestamp;
- if (!data.timestamp.isValid())
- newTimestamp = static_cast<quint64>(QDateTime::currentMSecsSinceEpoch() / 1000;
- else
- newTimestamp = static_cast<quint64>(data.timestamp.toSecsSinceEpoch();
- if (m_reading.close() != data.close) {
- m_reading.setTimestamp(newTimestamp);
- m_reading.setClose(data.close);
-
- newReadingAvailable();
- }
-}
-
diff --git a/src/plugins/sensors/simulator/simulatorproximitysensor.h b/src/plugins/sensors/simulator/simulatorproximitysensor.h
deleted file mode 100644
index 16e6f6bb..00000000
--- a/src/plugins/sensors/simulator/simulatorproximitysensor.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORPROXIMITYSENSOR_H
-#define SIMULATORPROXIMITYSENSOR_H
-
-#include "simulatorcommon.h"
-#include <qproximitysensor.h>
-
-class SimulatorProximitySensor : public SimulatorCommon
-{
-public:
- static const char *id;
-
- SimulatorProximitySensor(QSensor *sensor);
-
- void poll() override;
-private:
- QProximityReading m_reading;
-};
-
-#endif
-
diff --git a/src/plugins/sensors/winrt/CMakeLists.txt b/src/plugins/sensors/winrt/CMakeLists.txt
new file mode 100644
index 00000000..2099547e
--- /dev/null
+++ b/src/plugins/sensors/winrt/CMakeLists.txt
@@ -0,0 +1,26 @@
+#####################################################################
+## WinRtSensorPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(WinRtSensorPlugin
+ OUTPUT_NAME qtsensors_winrt
+ TYPE sensors
+ SOURCES
+ main.cpp
+ winrtaccelerometer.cpp winrtaccelerometer.h
+ winrtambientlightsensor.cpp winrtambientlightsensor.h
+ winrtcommon.cpp winrtcommon.h
+ winrtcompass.cpp winrtcompass.h
+ winrtgyroscope.cpp winrtgyroscope.h
+ winrtorientationsensor.cpp winrtorientationsensor.h
+ winrtrotationsensor.cpp winrtrotationsensor.h
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Sensors
+ LIBRARIES
+ Qt::CorePrivate
+ runtimeobject
+)
+
+#### Keys ignored in scope 1:.:.:winrt.pro:<TRUE>:
+# OTHER_FILES = "plugin.json"
diff --git a/src/plugins/sensors/winrt/winrt.pro b/src/plugins/sensors/winrt/winrt.pro
deleted file mode 100644
index 0de6293b..00000000
--- a/src/plugins/sensors/winrt/winrt.pro
+++ /dev/null
@@ -1,29 +0,0 @@
-TARGET = qtsensors_winrt
-QT = sensors core core_private
-
-HEADERS += \
- winrtaccelerometer.h \
- winrtambientlightsensor.h \
- winrtcommon.h \
- winrtcompass.h \
- winrtorientationsensor.h \
- winrtrotationsensor.h \
- winrtgyroscope.h
-
-SOURCES += \
- main.cpp \
- winrtaccelerometer.cpp \
- winrtambientlightsensor.cpp \
- winrtcommon.cpp \
- winrtcompass.cpp \
- winrtorientationsensor.cpp \
- winrtrotationsensor.cpp \
- winrtgyroscope.cpp
-
-OTHER_FILES = plugin.json
-
-LIBS += runtimeobject.lib
-
-PLUGIN_TYPE = sensors
-PLUGIN_CLASS_NAME = WinRtSensorPlugin
-load(qt_plugin)
diff --git a/src/sensors/CMakeLists.txt b/src/sensors/CMakeLists.txt
new file mode 100644
index 00000000..4a687b48
--- /dev/null
+++ b/src/sensors/CMakeLists.txt
@@ -0,0 +1,108 @@
+#####################################################################
+## Sensors Module:
+#####################################################################
+
+qt_internal_add_module(Sensors
+ PLUGIN_TYPES sensors sensorgestures
+ SOURCES
+ gestures/qsensorgesture.cpp gestures/qsensorgesture.h gestures/qsensorgesture_p.h
+ gestures/qsensorgesturemanager.cpp gestures/qsensorgesturemanager.h
+ gestures/qsensorgesturemanagerprivate.cpp gestures/qsensorgesturemanagerprivate_p.h
+ gestures/qsensorgestureplugininterface.cpp gestures/qsensorgestureplugininterface.h
+ gestures/qsensorgesturerecognizer.cpp gestures/qsensorgesturerecognizer.h
+ qsensorbackend.cpp qsensorbackend.h
+ qsensormanager.cpp qsensormanager.h
+ qsensorplugin.cpp qsensorplugin.h
+ qsensorsglobal.h
+ sensorlog_p.h
+ qsensor.h
+ qaccelerometer.h
+ qaltimeter.h
+ qambientlightsensor.h
+ qambienttemperaturesensor.h
+ qcompass.h
+ qdistancesensor.h
+ qholstersensor.h
+ qlightsensor.h
+ qmagnetometer.h
+ qorientationsensor.h
+ qproximitysensor.h
+ qirproximitysensor.h
+ qrotationsensor.h
+ qtapsensor.h
+ qtiltsensor.h
+ qgyroscope.h
+ qpressuresensor.h
+ qhumiditysensor.h
+ qlidsensor.h
+ qsensor_p.h
+ qaccelerometer_p.h
+ qaltimeter_p.h
+ qambientlightsensor_p.h
+ qambienttemperaturesensor_p.h
+ qcompass_p.h
+ qdistancesensor_p.h
+ qholstersensor_p.h
+ qlightsensor_p.h
+ qmagnetometer_p.h
+ qorientationsensor_p.h
+ qproximitysensor_p.h
+ qirproximitysensor_p.h
+ qrotationsensor_p.h
+ qtapsensor_p.h
+ qtiltsensor_p.h
+ qgyroscope_p.h
+ qpressuresensor_p.h
+ qhumiditysensor_p.h
+ qlidsensor_p.h
+ qsensor.cpp
+ qaccelerometer.cpp
+ qaltimeter.cpp
+ qambientlightsensor.cpp
+ qambienttemperaturesensor.cpp
+ qcompass.cpp
+ qdistancesensor.cpp
+ qholstersensor.cpp
+ qlightsensor.cpp
+ qmagnetometer.cpp
+ qorientationsensor.cpp
+ qproximitysensor.cpp
+ qirproximitysensor.cpp
+ qrotationsensor.cpp
+ qtapsensor.cpp
+ qtiltsensor.cpp
+ qgyroscope.cpp
+ qpressuresensor.cpp
+ qhumiditysensor.cpp
+ qlidsensor.cpp
+ DEFINES
+ $<$<CONFIG:Debug>:ENABLE_RUNTIME_SENSORLOG>
+ LIBRARIES
+ Qt::CorePrivate
+ PUBLIC_LIBRARIES
+ Qt::Core
+ PRIVATE_MODULE_INTERFACE
+ Qt::CorePrivate
+)
+
+if(ANDROID)
+ set_property(TARGET Sensors APPEND PROPERTY QT_ANDROID_LIB_DEPENDENCIES
+ plugins/sensors/libplugins_sensors_qtsensors_android.so
+ )
+endif()
+
+#### Keys ignored in scope 1:.:.:sensors.pro:<TRUE>:
+# SENSORS = "qsensor" "qaccelerometer" "qaltimeter" "qambientlightsensor" "qambienttemperaturesensor" "qcompass" "qdistancesensor" "qholstersensor" "qlightsensor" "qmagnetometer" "qorientationsensor" "qproximitysensor" "qirproximitysensor" "qrotationsensor" "qtapsensor" "qtiltsensor" "qgyroscope" "qpressuresensor" "qhumiditysensor" "qlidsensor"
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(Sensors CONDITION NOT SENSORS_CONFIG_PATH
+ DEFINES
+ QTSENSORS_CONFIG_PATH="${SENSORS_CONFIG_PATH}"
+)
+
+qt_internal_add_docs(Sensors
+ doc/qtsensors.qdocconf
+)
+
diff --git a/src/sensors/configure.cmake b/src/sensors/configure.cmake
new file mode 100644
index 00000000..06e0de59
--- /dev/null
+++ b/src/sensors/configure.cmake
@@ -0,0 +1,38 @@
+
+
+#### Inputs
+
+
+
+#### Libraries
+# special case begin
+if (LINUX)
+ qt_find_package(Sensorfw PROVIDED_TARGETS Sensorfw::Sensorfw MODULE_NAME sensors QMAKE_LIB sensorfw)
+endif()
+# special case end
+
+#### Tests
+
+
+
+#### Features
+
+# special case begin
+qt_feature("sensorfw" PRIVATE
+ LABEL "sensorfw"
+ CONDITION Sensorfw_FOUND
+)
+# special case end
+
+qt_configure_add_summary_section(NAME "Qt Sensors")
+if (LINUX)
+ # At the moment there is no Qt6 version of sensorfw, and while the
+ # FindSensorfw.cmake in this repo would find the package using pkg-config,
+ # it would not work. Once the Qt6 version exists, remove the
+ # "sensorfw_enabled_with_cmake" entry, enable build in
+ # src/plugins/sensors/CMakeLists.txt and fix any potential errors.
+ qt_configure_add_summary_entry(ARGS "sensorfw")
+ qt_configure_add_summary_entry(ARGS "sensorfw_enabled_with_cmake")
+ qt_configure_add_report(MESSAGE "SensorFW support currently not enabled with cmake")
+endif()
+qt_configure_end_summary_section() # end of "Qt Sensors" section
diff --git a/src/sensors/doc/snippets/sensorgestures/CMakeLists.txt b/src/sensors/doc/snippets/sensorgestures/CMakeLists.txt
new file mode 100644
index 00000000..eb46a95c
--- /dev/null
+++ b/src/sensors/doc/snippets/sensorgestures/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.14)
+project(sensorgesturessdocsnippet LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+find_package(Qt6 COMPONENTS Core Sensors)
+
+qt_add_executable(sensorgesturessdocsnippet
+ creating.cpp
+ main.cpp
+ myplugin.h
+ plugin.cpp
+)
+
+target_link_libraries(sensorgesturessdocsnippet PUBLIC
+ Qt::Sensors
+)
+
+if (GCC AND UNIX)
+ target_link_libraries(sensorgesturessdocsnippet PUBLIC
+ rdynamic
+ log
+ )
+endif()
diff --git a/src/sensors/doc/snippets/sensorgestures/sensorgestures.pro b/src/sensors/doc/snippets/sensorgestures/sensorgestures.pro
deleted file mode 100644
index 7442dd87..00000000
--- a/src/sensors/doc/snippets/sensorgestures/sensorgestures.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE=app
-TARGET=sensorgesturessdocsnippet
-QT = core sensors
-SOURCES+=main.cpp\
- creating.cpp\
- plugin.cpp
-HEADERS+=myplugin.h
-!win32:*g++*:LIBS+=-rdynamic
diff --git a/src/sensors/doc/snippets/sensors/CMakeLists.txt b/src/sensors/doc/snippets/sensors/CMakeLists.txt
new file mode 100644
index 00000000..a5c35e35
--- /dev/null
+++ b/src/sensors/doc/snippets/sensors/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.14)
+project(sensorsdocsnippet LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+find_package(Qt6 COMPONENTS Core Sensors)
+
+qt_add_executable(sensorsdocsnippet
+ creating.cpp
+ main.cpp
+ mybackend.h
+ plugin.cpp
+)
+
+target_link_libraries(sensorsdocsnippet PUBLIC
+ Qt::Sensors
+)
+
+if (GCC AND UNIX)
+ target_link_libraries(sensorsdocsnippet PUBLIC
+ rdynamic
+ log
+ )
+endif()
diff --git a/src/sensors/doc/snippets/sensors/sensors.pro b/src/sensors/doc/snippets/sensors/sensors.pro
deleted file mode 100644
index 91d49772..00000000
--- a/src/sensors/doc/snippets/sensors/sensors.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE=app
-TARGET=sensorsdocsnippet
-QT = core sensors
-SOURCES+=main.cpp\
- creating.cpp\
- start.cpp\
- plugin.cpp
-HEADERS+=mybackend.h
-!win32:*g++*:LIBS+=-rdynamic
-OTHER_FILES += *.qml
diff --git a/src/sensors/doc/snippets/snippets.pro b/src/sensors/doc/snippets/snippets.pro
deleted file mode 100644
index f73d4a35..00000000
--- a/src/sensors/doc/snippets/snippets.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += sensors
-SUBDIRS += sensorgestures
-
diff --git a/src/sensors/gestures/qsensorgesturemanagerprivate.cpp b/src/sensors/gestures/qsensorgesturemanagerprivate.cpp
index 81e87de0..09b068d6 100644
--- a/src/sensors/gestures/qsensorgesturemanagerprivate.cpp
+++ b/src/sensors/gestures/qsensorgesturemanagerprivate.cpp
@@ -46,10 +46,6 @@
#include "qsensorgesturemanagerprivate_p.h"
#include "qsensorgestureplugininterface.h"
-#ifdef SIMULATOR_BUILD
-#include "simulatorgesturescommon_p.h"
-#endif
-
Q_GLOBAL_STATIC(QSensorGestureManagerPrivate, sensorGestureManagerPrivate)
QT_BEGIN_NAMESPACE
@@ -57,18 +53,6 @@ QT_BEGIN_NAMESPACE
QSensorGestureManagerPrivate::QSensorGestureManagerPrivate(QObject *parent) :
QObject(parent)
{
-#ifdef SIMULATOR_BUILD
- SensorGesturesConnection *connection = new SensorGesturesConnection(this);
- connect(connection,SIGNAL(sensorGestureDetected()),
- this,SLOT(sensorGestureDetected()));
-
- connect(this,SIGNAL(newSensorGestures(QStringList)),
- connection,SLOT(newSensorGestures(QStringList)));
-
- connect(this,SIGNAL(removeSensorGestures(QStringList)),
- connection,SLOT(removeSensorGestures(QStringList)));
-#endif
-
loader = new QFactoryLoader("org.qt-project.QSensorGesturePluginInterface", QLatin1String("/sensorgestures"));
loadPlugins();
}
@@ -189,49 +173,6 @@ QStringList QSensorGestureManagerPrivate::gestureIds()
return knownIds;
}
-#ifdef SIMULATOR_BUILD
-void QSensorGestureManagerPrivate::sensorGestureDetected()
-{
- QString str = get_qtSensorGestureData();
-
- Q_FOREACH (const QString &id, gestureIds()) {
- QSensorGestureRecognizer *recognizer = sensorGestureRecognizer(id);
- if (recognizer != 0) {
- Q_FOREACH (const QString &sig, recognizer->gestureSignals()) {
- if (!sig.contains(QLatin1String("detected"))) { //weed out detected signals
- QString tmp;
- tmp = sig.left(sig.length() - 2);
- if (str == tmp) {
- // named signal for c++
- QMetaObject::invokeMethod(recognizer, str.toLocal8Bit(), Qt::DirectConnection);
- // detected signal for qml and c++
- QMetaObject::invokeMethod(recognizer, "detected", Qt::DirectConnection,
- Q_ARG(QString, str));
- break;
-
- }
- }
- }
- }
- }
-}
-
-void QSensorGestureManagerPrivate::recognizerStarted(const QSensorGestureRecognizer *recognizer)
-{
- QStringList list = recognizer->gestureSignals();
- list.removeOne(QLatin1String("detected(QString)"));
- Q_EMIT newSensorGestures(list);
-}
-
-void QSensorGestureManagerPrivate::recognizerStopped(const QSensorGestureRecognizer *recognizer)
-{
- QStringList list = recognizer->gestureSignals();
- list.removeOne(QLatin1String("detected(QString)"));
- Q_EMIT removeSensorGestures(list);
-}
-
-#endif
-
QSensorGestureManagerPrivate * QSensorGestureManagerPrivate::instance()
{
QSensorGestureManagerPrivate *priv = sensorGestureManagerPrivate();
diff --git a/src/sensors/gestures/qsensorgesturemanagerprivate_p.h b/src/sensors/gestures/qsensorgesturemanagerprivate_p.h
index 2ca4d648..e57ede49 100644
--- a/src/sensors/gestures/qsensorgesturemanagerprivate_p.h
+++ b/src/sensors/gestures/qsensorgesturemanagerprivate_p.h
@@ -86,24 +86,10 @@ public:
QStringList gestureIds();
QStringList knownIds;
void initPlugin(QObject *o);
-#ifdef SIMULATOR_BUILD
- void recognizerStarted(const QSensorGestureRecognizer *);
- void recognizerStopped(const QSensorGestureRecognizer *);
-#endif
static QSensorGestureManagerPrivate * instance();
Q_SIGNALS:
void newSensorGestureAvailable();
-
-#ifdef SIMULATOR_BUILD
-Q_SIGNALS:
- void newSensorGestures(QStringList);
- void removeSensorGestures(QStringList);
-
-private slots:
- void sensorGestureDetected();
-
-#endif
};
QT_END_NAMESPACE
diff --git a/src/sensors/gestures/qsensorgesturerecognizer.cpp b/src/sensors/gestures/qsensorgesturerecognizer.cpp
index c992ac01..d9a367eb 100644
--- a/src/sensors/gestures/qsensorgesturerecognizer.cpp
+++ b/src/sensors/gestures/qsensorgesturerecognizer.cpp
@@ -39,11 +39,8 @@
#include "qsensorgesturerecognizer.h"
#include "qsensorgesture_p.h"
-
#include "qsensorgesturemanager.h"
-#ifdef SIMULATOR_BUILD
-#include "qsensorgesturemanagerprivate_p.h"
-#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -187,12 +184,8 @@ void QSensorGestureRecognizer::startBackend()
qWarning() << "Not starting. Gesture Recognizer not initialized";
return;
}
- if (d_ptr->count++ == 0) {
+ if (d_ptr->count++ == 0)
start();
-#ifdef SIMULATOR_BUILD
- QSensorGestureManagerPrivate::instance()->recognizerStarted(this);
-#endif
- }
}
/*!
@@ -207,12 +200,8 @@ void QSensorGestureRecognizer::stopBackend()
qWarning() << "Not stopping. Gesture Recognizer not initialized";
return;
}
- if (--d_ptr->count == 0) {
+ if (--d_ptr->count == 0)
stop();
-#ifdef SIMULATOR_BUILD
- QSensorGestureManagerPrivate::instance()->recognizerStopped(this);
-#endif
- }
}
QT_END_NAMESPACE
diff --git a/src/sensors/gestures/simulatorgesturescommon.cpp b/src/sensors/gestures/simulatorgesturescommon.cpp
deleted file mode 100644
index b7860423..00000000
--- a/src/sensors/gestures/simulatorgesturescommon.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include "simulatorgesturescommon_p.h"
-
-#include <QtSimulator/version.h>
-#include <QtSimulator/QtSimulator>
-
-#include <QDebug>
-#include <QStringList>
-
-using namespace Simulator;
-
-
-Q_GLOBAL_STATIC(QString, qtSensorGestureData)
-
-SensorGesturesConnection::SensorGesturesConnection(QObject *parent)
- : QObject(parent)
-{
- mConnection = new Connection(Connection::Client, QLatin1String("QtSimulator_Mobility_ServerName1.3.0.0"),
- 0xbeef+1, Version(1,0,0,0), this);
- mWorker = mConnection->connectToServer(Connection::simulatorHostName(true), 0xbeef+1);
-
- if (!mWorker) {
- qWarning() << "Could not connect to server";
- return;
- }
-
- mWorker->addReceiver(this);
- mWorker->call("setRequestsSensorGestures");
-}
-
-SensorGesturesConnection::~SensorGesturesConnection()
-{
- mWorker->call("setSensorGestures", QStringList());
- delete mWorker;
-}
-
-void SensorGesturesConnection::setSensorGestureData(const QString &data)
-{
- QString gesture = data;
- if (data.contains(QLatin1String("detected"))) {
- gesture.remove(QLatin1String("detected("));
- gesture.remove(QLatin1String(")"));
- }
- *qtSensorGestureData() = gesture;
-}
-
-void SensorGesturesConnection::newSensorGestureDetected()
-{
- emit sensorGestureDetected();
-}
-
-void SensorGesturesConnection::newSensorGestures(const QStringList &gestures)
-{
- if (!mWorker) return;
-
- Q_FOREACH (const QString &gest, gestures) {
- if (!gest.contains(QLatin1String("detected"))) {
- QString tmp = gest.left(gest.length()-2);
- if (!allGestures.contains(tmp)) {
- allGestures.append(tmp);
- }
- }
- }
-
- mWorker->call("setSensorGestures", allGestures);
-}
-
-void SensorGesturesConnection::removeSensorGestures(const QStringList &gestures)
-{
- Q_FOREACH (const QString &gest, gestures) {
- QString tmp = gest.left(gest.length()-2);
- if (allGestures.contains(tmp)) {
- allGestures.removeOne(tmp);
- }
- }
- mWorker->call("setSensorGestures", allGestures);
-}
-
-QString get_qtSensorGestureData()
-{
- return *qtSensorGestureData();
-}
-
diff --git a/src/sensors/gestures/simulatorgesturescommon_p.h b/src/sensors/gestures/simulatorgesturescommon_p.h
deleted file mode 100644
index 63022238..00000000
--- a/src/sensors/gestures/simulatorgesturescommon_p.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 SIMULATORGESTURESCOMMON_H
-#define SIMULATORGESTURESCOMMON_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 <QtSimulator/connection.h>
-#include <QtSimulator/connectionworker.h>
-#include <QStringList>
-
-class QTimer;
-
-namespace Simulator
-{
- class Connection;
- class ConnectionWorker;
-}
-
-class SensorGesturesConnection : public QObject
-{
- Q_OBJECT
-public:
- explicit SensorGesturesConnection(QObject *parent = 0);
- virtual ~SensorGesturesConnection();
-
-Q_SIGNALS:
- void sensorGestureDetected();
-
-public slots:
- void setSensorGestureData(const QString &);
- void newSensorGestureDetected();
- void newSensorGestures(const QStringList &gestures);
- void removeSensorGestures(const QStringList &gestures);
-
-private:
- Simulator::Connection *mConnection;
- Simulator::ConnectionWorker *mWorker;
- QStringList allGestures;
-
-};
-
-QString get_qtSensorGestureData();
-
-#endif //SIMULATORGESTURESCOMMON_H
-
diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp
index d8bb0bee..ef1ef523 100644
--- a/src/sensors/qsensor.cpp
+++ b/src/sensors/qsensor.cpp
@@ -1362,7 +1362,7 @@ void QSensorReading::copyValuesFrom(QSensorReading *other)
\code
class MyReading : public QSensorReading
{
- Q_OBJECT
+ \Q_OBJECT
Q_PROPERTY(qreal myprop READ myprop)
DECLARE_READING(MyReading)
public:
@@ -1390,6 +1390,3 @@ void QSensorReading::copyValuesFrom(QSensorReading *other)
*/
QT_END_NAMESPACE
-
-#include "moc_qsensor.cpp"
-
diff --git a/src/sensors/qt_cmdline.cmake b/src/sensors/qt_cmdline.cmake
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/sensors/qt_cmdline.cmake
diff --git a/src/sensors/sensors.pro b/src/sensors/sensors.pro
deleted file mode 100644
index 79cb6e45..00000000
--- a/src/sensors/sensors.pro
+++ /dev/null
@@ -1,87 +0,0 @@
-TARGET = QtSensors
-CONFIG += strict_flags
-QT = core-private
-
-CONFIG(debug,debug|release):DEFINES += ENABLE_RUNTIME_SENSORLOG
-!isEmpty(SENSORS_CONFIG_PATH):DEFINES += "QTSENSORS_CONFIG_PATH=\\\"$$SENSORS_CONFIG_PATH\\\""
-
-qtHaveModule(simulator) {
- DEFINES += SIMULATOR_BUILD
- QT_FOR_PRIVATE += simulator
-}
-
-QMAKE_DOCS = $$PWD/doc/qtsensors.qdocconf
-
-ANDROID_LIB_DEPENDENCIES = \
- plugins/sensors/libplugins_sensors_qtsensors_android.so
-
-PUBLIC_HEADERS += \
- qsensorbackend.h\
- qsensormanager.h\
- qsensorplugin.h\
- qsensorsglobal.h
-
-PRIVATE_HEADERS += \
- sensorlog_p.h\
-
-SOURCES += qsensorbackend.cpp\
- qsensormanager.cpp\
- qsensorplugin.cpp
-
-SOURCES += \
- gestures/qsensorgesture.cpp \
- gestures/qsensorgesturerecognizer.cpp \
- gestures/qsensorgesturemanager.cpp \
- gestures/qsensorgesturemanagerprivate.cpp \
- gestures/qsensorgestureplugininterface.cpp
-
-GESTURE_HEADERS += \
- gestures/qsensorgesture.h\
- gestures/qsensorgesture_p.h\
- gestures/qsensorgesturerecognizer.h \
- gestures/qsensorgesturemanager.h \
- gestures/qsensorgesturemanagerprivate_p.h \
- gestures/qsensorgestureplugininterface.h
-
-qtHaveModule(simulator) {
- SOURCES += gestures/simulatorgesturescommon.cpp
- GESTURE_HEADERS += gestures/simulatorgesturescommon_p.h
-}
-
-# 3 files per sensor (including QSensor)
-SENSORS=\
- qsensor\
- qaccelerometer\
- qaltimeter\
- qambientlightsensor\
- qambienttemperaturesensor\
- qcompass\
- qdistancesensor\
- qholstersensor\
- qlightsensor\
- qmagnetometer\
- qorientationsensor\
- qproximitysensor\
- qirproximitysensor\
- qrotationsensor\
- qtapsensor\
- qtiltsensor\
- qgyroscope\
- qpressuresensor \
- qhumiditysensor \
- qlidsensor
-
-for(s,SENSORS) {
- # Client API
- PUBLIC_HEADERS += $${s}.h
- SOURCES += $${s}.cpp
- # Private header
- PRIVATE_HEADERS += $${s}_p.h
-}
-
-HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS $$GESTURE_HEADERS
-
-MODULE_PLUGIN_TYPES = \
- sensors \
- sensorgestures
-load(qt_module)
diff --git a/src/src.pro b/src/src.pro
deleted file mode 100644
index b3aa7ba0..00000000
--- a/src/src.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += sensors
-sensors.subdir = sensors
-sensors.target = sub-sensors
-
-qtHaveModule(quick) {
- SUBDIRS += imports
- imports.subdir = imports
- imports.target = sub-imports
- imports.depends = sensors
-}
-
-SUBDIRS += plugins
-plugins.subdir = plugins
-plugins.target = sub-plugins
-plugins.depends = sensors
-