summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf3
-rw-r--r--cmake/FindSensorfw.cmake2
-rw-r--r--coin/module_config.yaml1
-rw-r--r--config.tests/winrt/CMakeLists.txt7
-rw-r--r--dependencies.yaml4
-rw-r--r--examples/sensors/CMakeLists.txt1
-rw-r--r--examples/sensors/accelbubble/CMakeLists.txt14
-rw-r--r--examples/sensors/maze/CMakeLists.txt13
-rw-r--r--examples/sensors/sensorsshowcase/CMakeLists.txt70
-rw-r--r--examples/sensors/sensorsshowcase/Info.plist32
-rw-r--r--examples/sensors/sensorsshowcase/accelerometer.qml169
-rw-r--r--examples/sensors/sensorsshowcase/android/AndroidManifest.xml47
-rw-r--r--examples/sensors/sensorsshowcase/compass.qml111
-rw-r--r--examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-gyroscope.pngbin0 -> 29205 bytes
-rw-r--r--examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-mainview.pngbin0 -> 33722 bytes
-rw-r--r--examples/sensors/sensorsshowcase/doc/src/sensorsshowcase.qdoc95
-rw-r--r--examples/sensors/sensorsshowcase/gyroscope.qml221
-rw-r--r--examples/sensors/sensorsshowcase/images/compass.svg222
-rw-r--r--examples/sensors/sensorsshowcase/images/magnet.svg98
-rw-r--r--examples/sensors/sensorsshowcase/images/qt_logo.pngbin0 -> 6208 bytes
-rw-r--r--examples/sensors/sensorsshowcase/magnetometer.qml150
-rw-r--r--examples/sensors/sensorsshowcase/main.cpp61
-rw-r--r--examples/sensors/sensorsshowcase/proximity.qml118
-rw-r--r--examples/sensors/sensorsshowcase/sensorsshowcase.pro27
-rw-r--r--examples/sensors/sensorsshowcase/sensorsshowcase.qml123
-rw-r--r--examples/sensors/sensorsshowcase/sensorsshowcase.qrc13
-rw-r--r--src/plugins/sensors/ios/CMakeLists.txt1
-rw-r--r--src/plugins/sensors/ios/iospressure.h73
-rw-r--r--src/plugins/sensors/ios/iospressure.mm101
-rw-r--r--src/plugins/sensors/ios/main.mm5
-rw-r--r--src/sensors/CMakeLists.txt1
-rw-r--r--src/sensors/doc/qtsensors.qdocconf3
-rw-r--r--src/sensors/doc/src/compatmap.qdoc2
-rw-r--r--src/sensors/gestures/qsensorgesturemanagerprivate.cpp2
-rw-r--r--src/sensors/qsensormanager.cpp2
-rw-r--r--src/sensors/qsensorsglobal.h15
-rw-r--r--src/sensors/qtapsensor.cpp10
-rw-r--r--src/sensorsquick/CMakeLists.txt2
-rw-r--r--src/sensorsquick/qmlaccelerometer.cpp4
-rw-r--r--src/sensorsquick/qmlambientlightsensor.cpp4
-rw-r--r--src/sensorsquick/qmlambienttemperaturesensor.cpp4
-rw-r--r--src/sensorsquick/qmlcompass.cpp4
-rw-r--r--src/sensorsquick/qmlgyroscope.cpp4
-rw-r--r--src/sensorsquick/qmlhumiditysensor.cpp4
-rw-r--r--src/sensorsquick/qmlirproximitysensor.cpp4
-rw-r--r--src/sensorsquick/qmllidsensor.cpp4
-rw-r--r--src/sensorsquick/qmllightsensor.cpp4
-rw-r--r--src/sensorsquick/qmlmagnetometer.cpp4
-rw-r--r--src/sensorsquick/qmlorientationsensor.cpp4
-rw-r--r--src/sensorsquick/qmlpressuresensor.cpp4
-rw-r--r--src/sensorsquick/qmlproximitysensor.cpp4
-rw-r--r--src/sensorsquick/qmlrotationsensor.cpp4
-rw-r--r--src/sensorsquick/qmlsensor.cpp4
-rw-r--r--src/sensorsquick/qmlsensor_p.h1
-rw-r--r--src/sensorsquick/qmlsensorglobal.cpp2
-rw-r--r--src/sensorsquick/qmltapsensor.cpp4
-rw-r--r--src/sensorsquick/qmltiltsensor.cpp4
-rw-r--r--src/sensorsquick/qsensorsquickglobal_p.h17
58 files changed, 1829 insertions, 78 deletions
diff --git a/.qmake.conf b/.qmake.conf
deleted file mode 100644
index 35eafd1f..00000000
--- a/.qmake.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-load(qt_build_config)
-
-MODULE_VERSION = 6.3.0
diff --git a/cmake/FindSensorfw.cmake b/cmake/FindSensorfw.cmake
index 6b7ee507..22f3ee1f 100644
--- a/cmake/FindSensorfw.cmake
+++ b/cmake/FindSensorfw.cmake
@@ -6,5 +6,5 @@ if (PKG_CONFIG_FOUND)
endif()
else()
message("Sensorfw pkg not found. Looking for library")
- find_library(sensorfw)
+ find_library(Sensorfw sensorfw)
endif()
diff --git a/coin/module_config.yaml b/coin/module_config.yaml
index 16d158c6..aaf33238 100644
--- a/coin/module_config.yaml
+++ b/coin/module_config.yaml
@@ -10,3 +10,4 @@ instructions:
Test:
- !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
+ - !include "{{qt/qtbase}}/coin_module_test_docs.yaml"
diff --git a/config.tests/winrt/CMakeLists.txt b/config.tests/winrt/CMakeLists.txt
index d6db7de9..d0e46ca2 100644
--- a/config.tests/winrt/CMakeLists.txt
+++ b/config.tests/winrt/CMakeLists.txt
@@ -1,6 +1,13 @@
cmake_minimum_required(VERSION 3.16)
project(config_test_winrt LANGUAGES C CXX)
+if(DEFINED QT_CONFIG_COMPILE_TEST_CMAKE_SYSTEM_PREFIX_PATH)
+ set(CMAKE_SYSTEM_PREFIX_PATH "${QT_CONFIG_COMPILE_TEST_CMAKE_SYSTEM_PREFIX_PATH}")
+endif()
+if(DEFINED QT_CONFIG_COMPILE_TEST_CMAKE_SYSTEM_FRAMEWORK_PATH)
+ set(CMAKE_SYSTEM_FRAMEWORK_PATH "${QT_CONFIG_COMPILE_TEST_CMAKE_SYSTEM_FRAMEWORK_PATH}")
+endif()
+
foreach(p ${QT_CONFIG_COMPILE_TEST_PACKAGES})
find_package(${p})
endforeach()
diff --git a/dependencies.yaml b/dependencies.yaml
index de3bb6b9..1282eba3 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,7 +1,7 @@
dependencies:
../qtbase:
- ref: 2d5541d6c30c67d6a469cba372b6e336a2eeb626
+ ref: 147093edd9c8c1bd2a9fdda76c40f5aba378222b
required: true
../qtdeclarative:
- ref: 4e71f22e9108de2efc7c690285d90d55144301d6
+ ref: a00c3cd3d14865941cb21c7a0e59994d14404494
required: false
diff --git a/examples/sensors/CMakeLists.txt b/examples/sensors/CMakeLists.txt
index 329ae504..7fe6c4e9 100644
--- a/examples/sensors/CMakeLists.txt
+++ b/examples/sensors/CMakeLists.txt
@@ -7,6 +7,7 @@ if(TARGET Qt::Quick)
# add_subdirectory(shakeit)
if(TARGET Qt::Svg)
add_subdirectory(accelbubble)
+ add_subdirectory(sensorsshowcase)
endif()
endif()
# if(TARGET Qt::Widgets)
diff --git a/examples/sensors/accelbubble/CMakeLists.txt b/examples/sensors/accelbubble/CMakeLists.txt
index fe19731f..2709e7b2 100644
--- a/examples/sensors/accelbubble/CMakeLists.txt
+++ b/examples/sensors/accelbubble/CMakeLists.txt
@@ -22,6 +22,19 @@ set_target_properties(accelbubble PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
+if(ANDROID)
+ set_property(TARGET accelbubble PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/android)
+ endif()
+if(APPLE)
+ if(IOS)
+ set_property(TARGET accelbubble PROPERTY
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
+ )
+ endif()
+endif()
+
target_link_libraries(accelbubble PUBLIC
Qt::Core
Qt::Gui
@@ -31,7 +44,6 @@ target_link_libraries(accelbubble PUBLIC
Qt::Xml
)
-
# Resources:
set(accelbubble_resource_files
"accelbubble.qml"
diff --git a/examples/sensors/maze/CMakeLists.txt b/examples/sensors/maze/CMakeLists.txt
index 88334a3c..956047d0 100644
--- a/examples/sensors/maze/CMakeLists.txt
+++ b/examples/sensors/maze/CMakeLists.txt
@@ -22,6 +22,18 @@ set_target_properties(maze PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+if(ANDROID)
+ set_property(TARGET maze PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/android)
+ endif()
+if(APPLE)
+ if(IOS)
+ set_property(TARGET maze PROPERTY
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
+ )
+ endif()
+endif()
+
target_link_libraries(maze PUBLIC
Qt::Core
Qt::Gui
@@ -29,7 +41,6 @@ target_link_libraries(maze PUBLIC
Qt::Sensors
)
-
# Resources:
set(maze_resource_files
"Congratulation.qml"
diff --git a/examples/sensors/sensorsshowcase/CMakeLists.txt b/examples/sensors/sensorsshowcase/CMakeLists.txt
new file mode 100644
index 00000000..411630d7
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/CMakeLists.txt
@@ -0,0 +1,70 @@
+cmake_minimum_required(VERSION 3.16)
+project(sensorsshowcase LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/sensors/sensorsshowcase")
+
+find_package(Qt6 COMPONENTS Core Gui Quick Sensors Svg)
+
+qt_add_executable(sensorsshowcase
+ main.cpp
+)
+set_target_properties(sensorsshowcase PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+if(ANDROID)
+ set_property(TARGET sensorsshowcase PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/android)
+ endif()
+if(APPLE)
+ if(IOS)
+ set_property(TARGET sensorsshowcase PROPERTY
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
+ )
+ endif()
+endif()
+
+target_link_libraries(sensorsshowcase PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Quick
+ Qt::Sensors
+ Qt::Svg
+)
+
+# Resources:
+set(sensorsshowcase_resource_files
+ "sensorsshowcase.qml"
+ "accelerometer.qml"
+ "proximity.qml"
+ "compass.qml"
+ "magnetometer.qml"
+ "gyroscope.qml"
+ "images/magnet.svg"
+ "images/compass.svg"
+ "images/qt_logo.png"
+)
+
+qt6_add_resources(sensorsshowcase "sensorsshowcase"
+ PREFIX
+ "/"
+ FILES
+ ${sensorsshowcase_resource_files}
+)
+
+install(TARGETS sensorsshowcase
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/sensors/sensorsshowcase/Info.plist b/examples/sensors/sensorsshowcase/Info.plist
new file mode 100644
index 00000000..61d01e5a
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/Info.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>sensorsshowcase</string>
+ <key>CFBundleExecutable</key>
+ <string>sensorsshowcase</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.qt.sensorsshowcase</string>
+ <key>CFBundleName</key>
+ <string>sensorsshowcase</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UILaunchStoryboardName</key>
+ <string>LaunchScreen</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ </array>
+</dict>
+</plist>
diff --git a/examples/sensors/sensorsshowcase/accelerometer.qml b/examples/sensors/sensorsshowcase/accelerometer.qml
new file mode 100644
index 00000000..df7c7f1e
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/accelerometer.qml
@@ -0,0 +1,169 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtSensors
+
+Rectangle {
+ id: root
+ color: "dimgray"
+
+ function resetRotations() {
+ imageXRotation.angle = 0
+ imageYRotation.angle = 0
+ imageZRotation.angle = 0
+ }
+
+//! [0]
+ Accelerometer {
+ id: accelerometer
+ active: true
+ dataRate: 25
+
+ property real x: 0
+ property real y: 0
+ property real z: 0
+
+ onReadingChanged: {
+ x = reading.x
+ y = reading.y
+ z = reading.z
+
+ imageTranslation.x = -reading.x * 10
+ imageTranslation.y = reading.y * 10
+ }
+ }
+//! [0]
+
+ ColumnLayout {
+ anchors.fill: parent
+ id: layout
+
+ Text {
+ Layout.topMargin: titleTopMargin
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.preferredHeight: textHeight
+ color: "White"
+ text: "Accelerometer"
+ font.pixelSize: titleFontSize
+ }
+
+ Image {
+ id: image
+ Layout.alignment: Qt.AlignCenter
+ Layout.fillHeight: true
+ Layout.preferredWidth: root.width/2
+ Layout.preferredHeight: root.height/3
+ source: "qrc:/images/qt_logo.png"
+ fillMode: Image.PreserveAspectFit
+
+ transform: [
+ Translate {
+ id: imageTranslation
+ x: 0
+ y: 0
+ }
+ ]
+ }
+
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "X: " + accelerometer.x.toFixed(2)
+ font.pixelSize: textFontSize
+ }
+
+ ProgressBar {
+ id: xbar
+ value: 0.5 + (accelerometer.x / 100)
+ Layout.preferredWidth: root.width
+ }
+
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Y: " + accelerometer.y.toFixed(2)
+ font.pixelSize: textFontSize
+ }
+ ProgressBar {
+ id: ybar
+ value: 0.5 + (accelerometer.y / 100)
+ Layout.preferredWidth: root.width
+ }
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Z: " + accelerometer.z.toFixed(2)
+ font.pixelSize: textFontSize
+ }
+ ProgressBar {
+ id: zbar
+ value: 0.5 + (accelerometer.z / 100)
+ Layout.preferredWidth: root.width
+ }
+ Button {
+ Layout.alignment: Qt.AlignBottom
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: buttonHeight
+ text:"Back"
+ font.pixelSize: buttonFontSize
+ onClicked:stack.pop()
+ }
+ }
+}
+
diff --git a/examples/sensors/sensorsshowcase/android/AndroidManifest.xml b/examples/sensors/sensorsshowcase/android/AndroidManifest.xml
new file mode 100644
index 00000000..3c152a90
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/android/AndroidManifest.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.qtproject.example.sensorsshowcase"
+ android:installLocation="auto"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <!-- The comment below will be replaced with dependencies permissions upon deployment.
+ Remove the comment if you do not require these default permissions. -->
+ <!-- %%INSERT_PERMISSIONS -->
+
+ <!-- The comment below will be replaced with dependencies permissions upon deployment.
+ Remove the comment if you do not require these default features. -->
+ <!-- %%INSERT_FEATURES -->
+
+ <supports-screens
+ android:anyDensity="true"
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true" />
+ <application
+ android:name="org.qtproject.qt.android.bindings.QtApplication"
+ android:extractNativeLibs="true"
+ android:hardwareAccelerated="true"
+ android:label="-- %%INSERT_APP_NAME%% --"
+ android:requestLegacyExternalStorage="true">
+ <activity
+ android:name="org.qtproject.qt.android.bindings.QtActivity"
+ android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
+ android:label="-- %%INSERT_APP_NAME%% --"
+ android:launchMode="singleTop"
+ android:screenOrientation="portrait">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ <meta-data
+ android:name="android.app.lib_name"
+ android:value="-- %%INSERT_APP_LIB_NAME%% --" />
+ <meta-data
+ android:name="android.app.background_running"
+ android:value="false" />
+ <meta-data
+ android:name="android.app.extract_android_style"
+ android:value="minimal" />
+ </activity>
+ </application>
+</manifest>
diff --git a/examples/sensors/sensorsshowcase/compass.qml b/examples/sensors/sensorsshowcase/compass.qml
new file mode 100644
index 00000000..b0fee5e4
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/compass.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtSensors
+
+Rectangle {
+ id: root
+ color: "dimgray"
+ property real azimuth: 30
+ readonly property real buttonHeight: height/8
+
+ Compass {
+ id: compass
+ active: true
+ dataRate: 7
+ onReadingChanged: {
+ root.azimuth = -reading.azimuth
+ }
+ }
+
+ ColumnLayout {
+ anchors.fill: parent
+ id: layout
+
+ Text {
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.preferredHeight: titleHeight
+ Layout.topMargin: titleTopMargin
+ verticalAlignment: Text.AlignVCenter
+ color: "White"
+ text: "Compass"
+ font.pixelSize: titleFontSize
+ }
+ Image {
+ Layout.alignment: Qt.AlignCenter
+ Layout.fillHeight: true
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: root.height
+ id: arrow
+ source: "qrc:/images/compass.svg"
+ fillMode: Image.PreserveAspectFit
+ rotation:root.azimuth
+ }
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Azimuth: " + root.azimuth.toFixed(2) + "°"
+ font.pixelSize: textFontSize
+ }
+ Button {
+ Layout.alignment: Qt.AlignBottom
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: buttonHeight
+ text:"Back"
+ font.pixelSize: buttonFontSize
+ onClicked:stack.pop()
+ }
+ }
+}
diff --git a/examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-gyroscope.png b/examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-gyroscope.png
new file mode 100644
index 00000000..b26aa459
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-gyroscope.png
Binary files differ
diff --git a/examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-mainview.png b/examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-mainview.png
new file mode 100644
index 00000000..838b39c9
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/doc/images/sensorsshowcase-mainview.png
Binary files differ
diff --git a/examples/sensors/sensorsshowcase/doc/src/sensorsshowcase.qdoc b/examples/sensors/sensorsshowcase/doc/src/sensorsshowcase.qdoc
new file mode 100644
index 00000000..b845d5d7
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/doc/src/sensorsshowcase.qdoc
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example sensorsshowcase
+ \title Qt Sensors - Sensors Showcase
+ \brief The Sensors Showcase example demonstrates sensor usage with visual examples.
+ \ingroup qtsensors-examples
+
+ \image sensorsshowcase-mainview.png
+
+ \section1 Overview
+
+ On startup, the application shows a menu with buttons for the subviews for each sensor.
+ The sensor views instantiate the given sensor, display the sensor's values as numbers,
+ and also visualize them with a simple graphical representation.
+
+ \section1 Main Menu
+
+ The main view shows the title with the name of the application and a button for each
+ subview laid out evenly by a \c ColumnLayout. The navigation between the subviews
+ and the main menu is managed by a \c StackView.
+
+ \section1 Accelerometer View
+
+ The accelerometer view shows the current device acceleration values and moves around
+ an image with an amount that is opposite of the device acceleration giving the image
+ an inertia effect that is proportional with the movement of the device.
+
+ Moving around the image happens in the accelerometer \c onReadingChanged method.
+
+ \snippet sensorsshowcase/accelerometer.qml 0
+
+ Whenever there is a new accelerometer value the image translation coordinates are
+ updated accordingly.
+
+ \section1 Proximity View
+
+ The proximity view shows an image that is enlarged whenever the proximity sensor of
+ the device is covered.
+
+ \section1 Compass View
+
+ The compass view shows a compass image that is rotated according to the Compass sensor
+ reading value making the compass turn towards north.
+
+ \section1 Magnetometer View
+
+ The magnetometer view displays a magnet image that is rotated around an amount that is
+ decided by the rotation angle of the vector given by the x and y magnetometer values.
+ This results in general in the same rotation as the compass gives, demonstrating one use
+ case of how the magnetometer readings can be used. Since the magnetometer provides
+ readings along all three axes, there is more freedom with how these readings can be used.
+
+ \snippet sensorsshowcase/magnetometer.qml 0
+
+ \section1 Gyroscope View
+
+ \image sensorsshowcase-gyroscope.png
+
+ The gyroscope view also shows an image that is rotated around three axes with an amount
+ that is calculated from the gyroscope readings. Since the gyroscope provides relative
+ rotational change around the three spatial axes and the time between reading updates
+ can vary, the time of the readings are stored and the rotational change is normalized
+ based on the time passed between reading updates.
+
+ \snippet sensorsshowcase/gyroscope.qml 0
+
+ By pressing the reset button the image rotation is reset to 0.
+*/
+
diff --git a/examples/sensors/sensorsshowcase/gyroscope.qml b/examples/sensors/sensorsshowcase/gyroscope.qml
new file mode 100644
index 00000000..1575255c
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/gyroscope.qml
@@ -0,0 +1,221 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtSensors
+
+Rectangle {
+ id: root
+ color: "dimgray"
+
+ function resetRotations() {
+ imageXRotation.angle = 0
+ imageYRotation.angle = 0
+ imageZRotation.angle = 0
+ }
+
+//! [0]
+ Gyroscope {
+ id: gyroscope
+ active: true
+ dataRate: 25
+
+ property variant lastTimeStamp: 0
+
+ property real x: 0
+ property real y: 0
+ property real z: 0
+
+ onReadingChanged: {
+
+ x = reading.x
+ y = reading.y
+ z = reading.z
+
+ var firstCall = false
+ if (lastTimeStamp == 0) {
+ firstCall = true
+ }
+
+ var timeSinceLast = reading.timestamp - lastTimeStamp
+ lastTimeStamp = reading.timestamp
+
+ //Skipping the initial time jump from 0
+ if (firstCall === true) return
+
+ var normalizedX = reading.x * (timeSinceLast/1000000)
+ imageXRotation.angle += normalizedX
+
+ var normalizedY = reading.y * (timeSinceLast/1000000)
+ imageYRotation.angle -= normalizedY
+
+ var normalizedZ = reading.z * (timeSinceLast/1000000)
+ imageZRotation.angle += normalizedZ
+ }
+ }
+//! [0]
+
+ ColumnLayout {
+ anchors.fill: parent
+ id: layout
+
+ Text {
+ Layout.topMargin: titleTopMargin
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.preferredHeight: textHeight
+ color: "White"
+ text: "Gyroscope"
+ font.pixelSize: titleFontSize
+ }
+
+ Image {
+ id: image
+ Layout.alignment: Qt.AlignCenter
+ Layout.fillHeight: true
+ Layout.preferredWidth: root.height/3
+ Layout.preferredHeight: root.height/3
+ source: "qrc:/images/qt_logo.png"
+ fillMode: Image.PreserveAspectFit
+
+ transform: [
+ Rotation {
+ id: imageXRotation
+ origin.x: layout.width/2
+ origin.y: layout.height/3
+ axis.x: 1
+ axis.y: 0
+ axis.z: 0
+ angle: 0
+ },
+ Rotation {
+ id: imageYRotation
+ origin.x: layout.width/2
+ origin.y: layout.height/3
+ axis.x: 0
+ axis.y: 1
+ axis.z: 0
+ angle: 0
+ },
+ Rotation {
+ id: imageZRotation
+ origin.x: layout.width/2
+ origin.y: layout.height/3
+ axis.x: 0
+ axis.y: 0
+ axis.z: 1
+ angle: 0
+ }
+ ]
+ }
+
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "X: " + gyroscope.x.toFixed(2)
+ font.pixelSize: textFontSize
+ }
+
+ ProgressBar {
+ id: xbar
+ value: 0.5 + (gyroscope.x / 1000)
+ Layout.preferredWidth: root.width
+ }
+
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Y: " + gyroscope.y.toFixed(2)
+ font.pixelSize: textFontSize
+ }
+ ProgressBar {
+ id: ybar
+ value: 0.5 + (gyroscope.y / 1000)
+ Layout.preferredWidth: root.width
+ }
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Z: " + gyroscope.z.toFixed(2)
+ font.pixelSize: textFontSize
+ }
+ ProgressBar {
+ id: zbar
+ value: 0.5 + (gyroscope.z / 1000)
+ Layout.preferredWidth: root.width
+ }
+ Button {
+ Layout.alignment: Qt.AlignBottom
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: buttonHeight
+ text:"Reset rotation"
+ font.pixelSize: buttonFontSize
+ onClicked: {
+ resetRotations()
+ }
+ }
+ Button {
+ Layout.alignment: Qt.AlignBottom
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: buttonHeight
+ text:"Back"
+ font.pixelSize: buttonFontSize
+ onClicked:stack.pop()
+ }
+ }
+}
+
diff --git a/examples/sensors/sensorsshowcase/images/compass.svg b/examples/sensors/sensorsshowcase/images/compass.svg
new file mode 100644
index 00000000..009e6ffd
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/images/compass.svg
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="123.29776mm"
+ height="123.29776mm"
+ viewBox="0 0 123.29776 123.29776"
+ version="1.1"
+ id="svg5"
+ inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
+ sodipodi:docname="compass.svg"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview7"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:document-units="mm"
+ showgrid="false"
+ showborder="true"
+ inkscape:zoom="1.5554293"
+ inkscape:cx="118.61677"
+ inkscape:cy="123.76005"
+ inkscape:window-width="2560"
+ inkscape:window-height="1377"
+ inkscape:window-x="1912"
+ inkscape:window-y="72"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="layer1"
+ lock-margins="true"
+ fit-margin-top="15"
+ fit-margin-left="15"
+ fit-margin-right="15"
+ fit-margin-bottom="15" />
+ <defs
+ id="defs2" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="Layer 2"
+ style="display:inline"
+ transform="translate(7.215891,-13.196477)">
+ <path
+ sodipodi:type="star"
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.88976;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2691"
+ inkscape:flatsided="false"
+ sodipodi:sides="4"
+ sodipodi:cx="131.1535"
+ sodipodi:cy="547.11584"
+ sodipodi:r1="75.011292"
+ sodipodi:r2="15.353019"
+ sodipodi:arg1="0.77933767"
+ sodipodi:arg2="1.5647358"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 184.51497,599.83441 -53.26842,-37.36583 -52.811613,38.00874 37.365833,-53.26843 -38.008738,-52.81161 53.268428,37.36583 52.81161,-38.00874 -37.36583,53.26843 z"
+ transform="matrix(0.45357635,0,0,0.48302392,-5.0551384,-189.42468)" />
+ <circle
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path25062"
+ cx="54.432987"
+ cy="74.84536"
+ r="30" />
+ <circle
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.579683;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="circle25206"
+ cx="54.432987"
+ cy="74.84536"
+ r="34.780952" />
+ </g>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ style="display:inline"
+ transform="translate(7.215891,-13.196477)">
+ <path
+ sodipodi:type="star"
+ style="fill:none;stroke:#000000;stroke-width:1.88976;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path846"
+ inkscape:flatsided="false"
+ sodipodi:sides="4"
+ sodipodi:cx="205.73099"
+ sodipodi:cy="282.8801"
+ sodipodi:r1="176.15717"
+ sodipodi:r2="35.231434"
+ sodipodi:arg1="1.5707963"
+ sodipodi:arg2="2.3561945"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="M 205.73099,459.03726 180.8186,307.79248 29.573822,282.8801 180.8186,257.96771 l 24.91238,-151.24478 24.91239,151.24478 151.24478,24.91238 -151.24478,24.91239 z"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 54.432988,28.237108 2e-6,93.216502"
+ id="path991" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 7.8247403,74.845359 93.2164997,-3e-6"
+ id="path993" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 47.841587,68.253956 C 61.024391,81.436759 61.024391,81.436759 61.024391,81.436759"
+ id="path995" />
+ <path
+ style="fill:#ff0000;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 61.024391,68.253956 47.841587,81.436759"
+ id="path997" />
+ <path
+ style="fill:#ff0000;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 193.43534,269.62014 c -6.2322,-6.23407 -11.33698,-11.55089 -11.34397,-11.81517 -0.007,-0.26428 5.0921,-31.50414 11.33128,-69.4219 l 11.34397,-68.9414 0.0816,40.4123 c 0.0449,22.22675 0.0449,58.56721 0,80.75656 l -0.0816,40.34427 z"
+ id="path1073"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:#aa0000;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 206.57191,200.26456 c 0.0205,-44.46429 0.0937,-80.62717 0.16276,-80.36197 0.27012,1.03808 22.62323,137.13728 22.62323,137.74386 0,0.42036 -3.98335,4.62794 -11.41164,12.05401 l -11.41164,11.40825 z"
+ id="path1186"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:#0000ff;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 206.57191,365.49565 -0.0373,-80.84415 11.41164,11.40825 c 7.42829,7.42607 11.41164,11.63365 11.41164,12.05401 0,0.60657 -22.35311,136.70578 -22.62323,137.74386 -0.069,0.2652 -0.14225,-35.89769 -0.16276,-80.36197 z"
+ id="path1336"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:#0000aa;fill-opacity:1;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 193.41121,377.30741 C 187.17832,339.428 182.08439,308.218 182.09137,307.95187 c 0.007,-0.26613 5.14794,-5.61759 11.42434,-11.89212 l 11.41164,-11.40825 v 80.76379 c 0,44.42008 -0.0413,80.76378 -0.0918,80.76378 -0.0505,0 -5.19144,-30.99224 -11.42433,-68.87166 z"
+ id="path1412"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 41.628379,282.04372 c 0.2652,-0.0654 31.724078,-5.25942 69.908621,-11.5423 l 69.42643,-11.4234 11.57959,11.57959 11.57958,11.57958 -81.4882,-0.0373 c -44.818513,-0.0205 -81.271221,-0.0908 -81.006021,-0.15619 z"
+ id="path2360"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 111.38404,295.24525 c -37.746813,-6.24278 -68.992206,-11.41247 -69.434206,-11.48821 -0.442001,-0.0757 35.865552,-0.15937 80.683446,-0.18586 l 81.48708,-0.0482 -11.56902,11.57237 c -6.36296,6.3648 -11.78675,11.55617 -12.05287,11.53638 -0.26612,-0.0198 -31.36762,-5.14373 -69.11443,-11.38651 z"
+ id="path2436"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 218.92415,270.65241 11.58478,-11.58478 69.42124,11.42566 c 38.18168,6.28411 69.63822,11.48048 69.90342,11.54749 0.2652,0.067 -36.18751,0.13862 -81.00602,0.15913 l -81.4882,0.0373 z"
+ id="path2475"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.607473;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 218.91063,295.09538 -11.56902,-11.57237 81.48708,0.0373 c 44.81789,0.0205 81.2701,0.0921 81.0049,0.15913 -0.42568,0.10756 -139.03687,22.94832 -139.26393,22.94832 -0.0495,0 -5.29607,-5.20757 -11.65903,-11.57237 z"
+ id="path2514"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.21495;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 51.111292,281.19388 c 0.5304,-0.13818 29.895283,-5.01467 65.255298,-10.83664 l 64.29093,-10.5854 10.92713,10.91122 10.92713,10.91123 -76.18242,-0.0746 c -41.900341,-0.041 -75.748469,-0.18764 -75.218068,-0.32583 z"
+ id="path2999"
+ transform="scale(0.26458333)" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.21495;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 219.88208,295.10818 -10.92236,-10.94226 76.17766,0.0508 c 41.89771,0.0279 75.88835,0.15784 75.53475,0.28872 -0.3536,0.13088 -28.99521,4.88871 -63.64802,10.57296 -34.65281,5.68424 -63.72839,10.47833 -64.61239,10.65353 -1.3859,0.27467 -3.11163,-1.18855 -12.52964,-10.62371 z"
+ id="path3075"
+ transform="scale(0.26458333)" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
+ x="48.989689"
+ y="16.670103"
+ id="text6475"><tspan
+ sodipodi:role="line"
+ id="tspan6473"
+ style="stroke-width:0.264583"
+ x="48.989689"
+ y="16.670103"></tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
+ x="50.474586"
+ y="25.95421"
+ id="text29322"><tspan
+ sodipodi:role="line"
+ id="tspan29320"
+ style="stroke-width:0.264583"
+ x="50.474586"
+ y="25.95421">N</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
+ x="51.019772"
+ y="131.41812"
+ id="text33982"><tspan
+ sodipodi:role="line"
+ id="tspan33980"
+ style="stroke-width:0.264583"
+ x="51.019772"
+ y="131.41812">S</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
+ x="104.54184"
+ y="78.702988"
+ id="text37802"><tspan
+ sodipodi:role="line"
+ id="tspan37800"
+ style="stroke-width:0.264583"
+ x="104.54184"
+ y="78.702988">E</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
+ x="-4.1540327"
+ y="78.702988"
+ id="text39852"><tspan
+ sodipodi:role="line"
+ id="tspan39850"
+ style="stroke-width:0.264583"
+ x="-4.1540327"
+ y="78.702988">W</tspan></text>
+ </g>
+</svg>
diff --git a/examples/sensors/sensorsshowcase/images/magnet.svg b/examples/sensors/sensorsshowcase/images/magnet.svg
new file mode 100644
index 00000000..21d9f46b
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/images/magnet.svg
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="152.6804mm"
+ height="186.70102mm"
+ viewBox="0 0 152.6804 186.70102"
+ version="1.1"
+ id="svg22292"
+ sodipodi:docname="magnet.svg"
+ inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview22294"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:document-units="mm"
+ showgrid="false"
+ inkscape:zoom="3.1108586"
+ inkscape:cx="384.62051"
+ inkscape:cy="214.24953"
+ inkscape:window-width="2560"
+ inkscape:window-height="1377"
+ inkscape:window-x="1912"
+ inkscape:window-y="72"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="layer1" />
+ <defs
+ id="defs22289" />
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0.34020391,-51.711357)">
+ <path
+ style="fill:none;stroke:#0000ff;stroke-width:40;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path22661"
+ sodipodi:type="arc"
+ sodipodi:cx="76.206184"
+ sodipodi:cy="162.27835"
+ sodipodi:rx="56.134018"
+ sodipodi:ry="56.134018"
+ sodipodi:start="1.5707963"
+ sodipodi:end="3.1415927"
+ sodipodi:arc-type="arc"
+ d="M 76.206184,218.41237 A 56.134018,56.134018 0 0 1 36.513439,201.9711 56.134018,56.134018 0 0 1 20.072166,162.27835"
+ sodipodi:open="true" />
+ <rect
+ style="fill:#cccccc;fill-opacity:1;stroke:none;stroke-width:0.814709;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect22976"
+ width="39.829895"
+ height="50.35051"
+ x="0.17010537"
+ y="51.711357" />
+ <path
+ style="fill:#ff0000;stroke:#ff0000;stroke-width:40;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path23734"
+ sodipodi:type="arc"
+ sodipodi:cx="-76.206184"
+ sodipodi:cy="162.27835"
+ sodipodi:rx="56.134018"
+ sodipodi:ry="56.134018"
+ sodipodi:start="1.5707963"
+ sodipodi:end="3.1415927"
+ sodipodi:arc-type="arc"
+ d="M -76.206184,218.41237 A 56.134018,56.134018 0 0 1 -115.89893,201.9711 56.134018,56.134018 0 0 1 -132.3402,162.27835"
+ sodipodi:open="true"
+ transform="scale(-1,1)" />
+ <rect
+ style="fill:#cccccc;fill-opacity:1;stroke:none;stroke-width:0.816447;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect24456"
+ width="40"
+ height="50.35051"
+ x="112.26804"
+ y="51.711357" />
+ <rect
+ style="fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1.00283;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect24480"
+ width="40"
+ height="60.340206"
+ x="112.26804"
+ y="102.06187" />
+ <rect
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.00563;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect24580"
+ width="39.829895"
+ height="60.93557"
+ x="0.17010537"
+ y="102.06187" />
+ </g>
+</svg>
diff --git a/examples/sensors/sensorsshowcase/images/qt_logo.png b/examples/sensors/sensorsshowcase/images/qt_logo.png
new file mode 100644
index 00000000..30c621c9
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/images/qt_logo.png
Binary files differ
diff --git a/examples/sensors/sensorsshowcase/magnetometer.qml b/examples/sensors/sensorsshowcase/magnetometer.qml
new file mode 100644
index 00000000..17732c7f
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/magnetometer.qml
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtSensors
+
+Rectangle {
+ id: root
+ color: "dimgray"
+
+ property real magnetRotation: 40
+ property real magnetometerX: 0
+ property real magnetometerY: 0
+ property real magnetometerZ: 0
+ property int barScaleFactor: 10000
+
+//! [0]
+ Magnetometer {
+ id: magnetometer
+ active: true
+ dataRate: 25
+ onReadingChanged: {
+ root.magnetometerX = reading.x
+ root.magnetometerY = reading.y
+ root.magnetometerZ = reading.z
+ root.magnetRotation = ((Math.atan2(reading.x, reading.y) / Math.PI) * 180)
+ }
+ }
+//! [0]
+
+ ColumnLayout {
+ anchors.fill: parent
+ id: layout
+
+ Text {
+ Layout.topMargin: titleTopMargin
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.preferredHeight: titleHeight
+ verticalAlignment: Text.AlignVCenter
+ color: "White"
+ text: "Magnetometer"
+ font.pixelSize: titleFontSize
+ }
+ Image {
+ Layout.alignment: Qt.AlignCenter
+ Layout.fillHeight: true
+ Layout.preferredWidth: root.width / 2
+ Layout.preferredHeight: root.height / 2
+ source: "qrc:/images/magnet.svg"
+ fillMode: Image.PreserveAspectFit
+ rotation: magnetRotation
+ }
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "X: " + root.magnetometerX.toFixed(9)
+ font.pixelSize: textFontSize
+ }
+ ProgressBar {
+ id: xbar
+ value: 0.5 + (root.magnetometerX * barScaleFactor)
+ Layout.preferredWidth: root.width
+ }
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Y: " + root.magnetometerY.toFixed(9)
+ font.pixelSize: textFontSize
+ }
+ ProgressBar {
+ id: ybar
+ value: 0.5 + (root.magnetometerY * barScaleFactor)
+ Layout.preferredWidth: root.width
+ }
+ Text {
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Z: " + root.magnetometerZ.toFixed(9)
+ font.pixelSize: textFontSize
+ }
+ ProgressBar {
+ id: zbar
+ value: 0.5 + (root.magnetometerZ * barScaleFactor)
+ Layout.preferredWidth: root.width
+ }
+ Button {
+ Layout.alignment: Qt.AlignBottom
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: buttonHeight
+ text:"Back"
+ font.pixelSize: buttonFontSize
+ onClicked:stack.pop()
+ }
+ }
+}
diff --git a/examples/sensors/sensorsshowcase/main.cpp b/examples/sensors/sensorsshowcase/main.cpp
new file mode 100644
index 00000000..4ee79963
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/main.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtGui/QGuiApplication>
+#include <QtQml/QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc,argv);
+ QQmlApplicationEngine engine(QUrl("qrc:///sensorsshowcase.qml"));
+
+ return app.exec();
+}
diff --git a/examples/sensors/sensorsshowcase/proximity.qml b/examples/sensors/sensorsshowcase/proximity.qml
new file mode 100644
index 00000000..3a235490
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/proximity.qml
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtSensors
+
+Rectangle {
+ id: root
+ color: "dimgray"
+ property bool near: false
+
+ ProximitySensor {
+ id: proximity
+ active: true
+ onReadingChanged: {
+ root.near = reading.near
+ }
+ }
+
+ ColumnLayout {
+ anchors.fill: parent
+ id: layout
+
+ Text {
+ Layout.topMargin: titleTopMargin
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ Layout.preferredHeight: textHeight
+ color: "White"
+ text: "Proximity"
+ font.pixelSize: titleFontSize
+ }
+ Image {
+ Layout.alignment: Qt.AlignCenter
+ Layout.fillHeight: true
+ Layout.preferredWidth: root.near ? root.height/3 : root.height/4
+ Layout.preferredHeight: root.near ? root.height/3 : root.height/4
+ source: "qrc:/images/qt_logo.png"
+ fillMode: Image.PreserveAspectFit
+ }
+ Text {
+ visible: !proximity
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ font.pixelSize: textFontSize
+ verticalAlignment: Text.AlignVCenter
+ wrapMode: Text.WordWrap
+ color: "White"
+ text: "The proximity sensor is not available on this device!"
+ }
+ Text {
+// visible: typeof proximity.available !== 'undefined'
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: textHeight
+ Layout.leftMargin: layout.spacing
+ color: "White"
+ text: "Near: " + root.near
+ font.pixelSize: textFontSize
+ }
+ Button {
+ Layout.alignment: Qt.AlignBottom
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: buttonHeight
+ text:"Back"
+ font.pixelSize: buttonFontSize
+ onClicked:stack.pop()
+ }
+ }
+}
diff --git a/examples/sensors/sensorsshowcase/sensorsshowcase.pro b/examples/sensors/sensorsshowcase/sensorsshowcase.pro
new file mode 100644
index 00000000..f57733f5
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/sensorsshowcase.pro
@@ -0,0 +1,27 @@
+TEMPLATE = app
+TARGET = sensorsshowcase
+QT += quick sensors svg
+SOURCES = main.cpp
+
+RESOURCES += \
+ sensorsshowcase.qrc
+
+OTHER_FILES = \
+ $$files(*.qml) \
+ images \
+ android/AndroidManifest.xml
+
+target.path = $$[QT_INSTALL_EXAMPLES]/sensors/sensorsshowcase
+INSTALLS += target
+
+ios {
+QMAKE_INFO_PLIST = Info.plist
+
+# manual plugin loading needed with older Qt
+# QTPLUGIN += qsvg qtsensors_ios qtsensors_generic
+}
+
+ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
+
+EXAMPLE_FILES += \
+ Info.plist
diff --git a/examples/sensors/sensorsshowcase/sensorsshowcase.qml b/examples/sensors/sensorsshowcase/sensorsshowcase.qml
new file mode 100644
index 00000000..dda6cda5
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/sensorsshowcase.qml
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtSensors
+
+ApplicationWindow {
+ title: "Sensors Showcase"
+ id: mainWindow
+ width: 540
+ height: 1200
+ visible: true
+ color: "dimgray"
+
+ property int titleHeight: height/7
+ readonly property real buttonHeight: height/7
+ property int textHeight: height/24
+ readonly property int buttonFontSize: 30
+ readonly property int textFontSize: 20
+ readonly property int titleFontSize: 35
+ readonly property int titleTopMargin: mainWindow.height/24
+
+ StackView {
+ id: stack
+ anchors.fill: parent
+ initialItem: ColumnLayout {
+ width: stack.width
+ Text {
+ Layout.topMargin: mainWindow.height/12
+ Layout.alignment: Qt.AlignCenter
+ Layout.preferredHeight: titleHeight
+ text: "Sensors Showcase"
+ color: "White"
+ font.pixelSize: titleFontSize
+ }
+
+ Button {
+ Layout.fillHeight: true
+ Layout.preferredWidth: stack.width
+ text: "Accelerometer"
+ font.pixelSize: buttonFontSize
+ onClicked: stack.push("qrc:/accelerometer.qml")
+ }
+ Button {
+ Layout.fillHeight: true
+ Layout.preferredWidth: stack.width
+ text: "Proximity"
+ font.pixelSize: buttonFontSize
+ onClicked: stack.push("qrc:/proximity.qml")
+ }
+ Button {
+ Layout.fillHeight: true
+ Layout.preferredWidth: stack.width
+ text: "Compass"
+ font.pixelSize: buttonFontSize
+ onClicked: stack.push("qrc:/compass.qml")
+ }
+ Button {
+ Layout.fillHeight: true
+ Layout.preferredWidth: stack.width
+ text: "Magnetometer"
+ font.pixelSize: buttonFontSize
+ onClicked: stack.push("qrc:/magnetometer.qml")
+ }
+ Button {
+ Layout.fillHeight: true
+ Layout.preferredWidth: stack.width
+ text: "Gyroscope"
+ font.pixelSize: buttonFontSize
+ onClicked: stack.push("qrc:/gyroscope.qml")
+ }
+ }
+ }
+}
diff --git a/examples/sensors/sensorsshowcase/sensorsshowcase.qrc b/examples/sensors/sensorsshowcase/sensorsshowcase.qrc
new file mode 100644
index 00000000..e647c384
--- /dev/null
+++ b/examples/sensors/sensorsshowcase/sensorsshowcase.qrc
@@ -0,0 +1,13 @@
+<RCC>
+ <qresource prefix="/">
+ <file>sensorsshowcase.qml</file>
+ <file>accelerometer.qml</file>
+ <file>proximity.qml</file>
+ <file>compass.qml</file>
+ <file>magnetometer.qml</file>
+ <file>gyroscope.qml</file>
+ <file>images/magnet.svg</file>
+ <file>images/compass.svg</file>
+ <file>images/qt_logo.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/sensors/ios/CMakeLists.txt b/src/plugins/sensors/ios/CMakeLists.txt
index 56a47f17..ba60a197 100644
--- a/src/plugins/sensors/ios/CMakeLists.txt
+++ b/src/plugins/sensors/ios/CMakeLists.txt
@@ -38,6 +38,7 @@ qt_internal_extend_target(IOSSensorPlugin CONDITION UIKIT AND NOT TVOS
iosaccelerometer.h iosaccelerometer.mm
iosgyroscope.h iosgyroscope.mm
iosmagnetometer.h iosmagnetometer.mm
+ iospressure.h iospressure.mm
iosmotionmanager.h iosmotionmanager.mm
DEFINES
HAVE_COREMOTION
diff --git a/src/plugins/sensors/ios/iospressure.h b/src/plugins/sensors/ios/iospressure.h
new file mode 100644
index 00000000..f4796e11
--- /dev/null
+++ b/src/plugins/sensors/ios/iospressure.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef IOSPRESSURE_H
+#define IOSPRESSURE_H
+
+#include <qsensorbackend.h>
+#include <qpressuresensor.h>
+
+@class CMAltimeter;
+
+QT_BEGIN_NAMESPACE
+
+class IOSPressure : public QSensorBackend
+{
+public:
+ static char const * const id;
+
+ explicit IOSPressure(QSensor *sensor);
+ ~IOSPressure();
+ void timerEvent(QTimerEvent *) override;
+
+ void start() override;
+ void stop() override;
+
+private:
+ Q_DISABLE_COPY_MOVE(IOSPressure)
+ CMAltimeter *m_altimeter = nullptr;
+ QPressureReading m_reading;
+ int m_timer = 0;
+
+ static int s_startCount;
+};
+QT_END_NAMESPACE
+
+#endif // IOSPRESSURE_H
+
diff --git a/src/plugins/sensors/ios/iospressure.mm b/src/plugins/sensors/ios/iospressure.mm
new file mode 100644
index 00000000..8d72dfb6
--- /dev/null
+++ b/src/plugins/sensors/ios/iospressure.mm
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "iospressure.h"
+#import <CoreMotion/CoreMotion.h>
+
+char const * const IOSPressure::id("ios.pressure");
+
+QT_BEGIN_NAMESPACE
+
+int IOSPressure::s_startCount = 0;
+
+IOSPressure::IOSPressure(QSensor *sensor)
+ : QSensorBackend(sensor)
+{
+ m_altimeter = [[CMAltimeter alloc] init];
+ setReading<QPressureReading>(&m_reading);
+ addDataRate(1, 100); // 100Hz
+}
+
+IOSPressure::~IOSPressure()
+{
+ [m_altimeter stopRelativeAltitudeUpdates];
+ [m_altimeter release];
+}
+
+void IOSPressure::start()
+{
+ if (m_timer != 0)
+ return;
+
+ int hz = sensor()->dataRate();
+ m_timer = startTimer(1000 / (hz == 0 ? 60 : hz));
+ if (++s_startCount == 1) {
+ [m_altimeter startRelativeAltitudeUpdatesToQueue:[NSOperationQueue mainQueue]
+ withHandler:^(CMAltitudeData * _Nullable altitudeData , NSError * _Nullable error) {
+ if (error == nil) {
+ m_reading.setPressure([altitudeData.pressure doubleValue] * 1000);
+ m_reading.setTimestamp(quint64(altitudeData.timestamp * 1e6));
+ }
+ }];
+ }
+}
+
+void IOSPressure::stop()
+{
+ if (m_timer == 0)
+ return;
+
+ killTimer(m_timer);
+ m_timer = 0;
+ if (--s_startCount == 0)
+ [m_altimeter stopRelativeAltitudeUpdates];
+}
+
+void IOSPressure::timerEvent(QTimerEvent *)
+{
+ // skip update if NaN or 0
+ if ((m_reading.pressure() != m_reading.pressure()) ||
+ m_reading.pressure() == 0)
+ return;
+ newReadingAvailable();
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/sensors/ios/main.mm b/src/plugins/sensors/ios/main.mm
index 13c71961..b27ff46e 100644
--- a/src/plugins/sensors/ios/main.mm
+++ b/src/plugins/sensors/ios/main.mm
@@ -47,6 +47,7 @@
#include "iosmagnetometer.h"
#include "ioscompass.h"
#include "iosproximitysensor.h"
+#include "iospressure.h"
#import <CoreLocation/CoreLocation.h>
#ifdef HAVE_COREMOTION
@@ -67,6 +68,8 @@ public:
QSensorManager::registerBackend(QGyroscope::sensorType, IOSGyroscope::id, this);
if ([QIOSMotionManager sharedManager].magnetometerAvailable)
QSensorManager::registerBackend(QMagnetometer::sensorType, IOSMagnetometer::id, this);
+ if ([CMAltimeter isRelativeAltitudeAvailable])
+ QSensorManager::registerBackend(QPressureSensor::sensorType, IOSPressure::id, this);
#endif
#ifdef HAVE_COMPASS
if ([CLLocationManager headingAvailable])
@@ -87,6 +90,8 @@ public:
return new IOSGyroscope(sensor);
if (sensor->identifier() == IOSMagnetometer::id)
return new IOSMagnetometer(sensor);
+ if (sensor->identifier() == IOSPressure::id)
+ return new IOSPressure(sensor);
#endif
#ifdef HAVE_COMPASS
if (sensor->identifier() == IOSCompass::id)
diff --git a/src/sensors/CMakeLists.txt b/src/sensors/CMakeLists.txt
index 1d1755cb..9b0ed256 100644
--- a/src/sensors/CMakeLists.txt
+++ b/src/sensors/CMakeLists.txt
@@ -74,6 +74,7 @@ qt_internal_add_module(Sensors
Qt::Core
PRIVATE_MODULE_INTERFACE
Qt::CorePrivate
+ GENERATE_CPP_EXPORTS
)
if(ANDROID)
diff --git a/src/sensors/doc/qtsensors.qdocconf b/src/sensors/doc/qtsensors.qdocconf
index e7789f9b..65808772 100644
--- a/src/sensors/doc/qtsensors.qdocconf
+++ b/src/sensors/doc/qtsensors.qdocconf
@@ -60,3 +60,6 @@ depends += qtcore qtdoc qtgui qtquick
navigation.landingpage = "Qt Sensors"
navigation.cppclassespage = "Qt Sensors C++ Classes"
navigation.qmltypespage = "Qt Sensors QML Types"
+
+# Fail the documentation build if there are more warnings than the limit
+warninglimit = 0
diff --git a/src/sensors/doc/src/compatmap.qdoc b/src/sensors/doc/src/compatmap.qdoc
index ef1340b8..025af476 100644
--- a/src/sensors/doc/src/compatmap.qdoc
+++ b/src/sensors/doc/src/compatmap.qdoc
@@ -127,7 +127,7 @@
<td nowrap="nowrap">Pressure Sensor</td>
<td bgcolor="green"></td>
<td bgcolor="gray"></td>
- <td bgcolor="gray"></td>
+ <td bgcolor="green"></td>
<td bgcolor="gray"></td>
<td bgcolor="gray"></td>
</tr>
diff --git a/src/sensors/gestures/qsensorgesturemanagerprivate.cpp b/src/sensors/gestures/qsensorgesturemanagerprivate.cpp
index 8c998db6..b6424d4a 100644
--- a/src/sensors/gestures/qsensorgesturemanagerprivate.cpp
+++ b/src/sensors/gestures/qsensorgesturemanagerprivate.cpp
@@ -90,7 +90,7 @@ void QSensorGestureManagerPrivate::loadPlugins()
for (QObject *plugin : QPluginLoader::staticInstances())
initPlugin(plugin);
- QList<QJsonObject> meta = loader->metaData();
+ QList<QPluginParsedMetaData> meta = loader->metaData();
for (int i = 0; i < meta.count(); i++) {
QObject *plugin = loader->instance(i);
initPlugin(plugin);
diff --git a/src/sensors/qsensormanager.cpp b/src/sensors/qsensormanager.cpp
index d6dcb45c..0718c508 100644
--- a/src/sensors/qsensormanager.cpp
+++ b/src/sensors/qsensormanager.cpp
@@ -218,7 +218,7 @@ void QSensorManagerPrivate::loadPlugins()
initPlugin(plugin, false /*do not warn on fail*/);
if (d->loadExternalPlugins) {
SENSORLOG() << "initializing plugins";
- QList<QJsonObject> meta = d->loader->metaData();
+ QList<QPluginParsedMetaData> meta = d->loader->metaData();
for (int i = 0; i < meta.count(); i++) {
QObject *plugin = d->loader->instance(i);
initPlugin(plugin);
diff --git a/src/sensors/qsensorsglobal.h b/src/sensors/qsensorsglobal.h
index 70985c27..3dd4eeb8 100644
--- a/src/sensors/qsensorsglobal.h
+++ b/src/sensors/qsensorsglobal.h
@@ -41,20 +41,7 @@
#define QSENSORSGLOBAL_H
#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_STATIC
-# if defined(QT_BUILD_SENSORS_LIB)
-# define Q_SENSORS_EXPORT Q_DECL_EXPORT
-# else
-# define Q_SENSORS_EXPORT Q_DECL_IMPORT
-# endif
-#else
-# define Q_SENSORS_EXPORT
-#endif
-
-QT_END_NAMESPACE
+#include <QtSensors/qtsensorsexports.h>
#endif // QSENSORSGLOBAL_H
diff --git a/src/sensors/qtapsensor.cpp b/src/sensors/qtapsensor.cpp
index a0df3cd3..c9cb0eb3 100644
--- a/src/sensors/qtapsensor.cpp
+++ b/src/sensors/qtapsensor.cpp
@@ -84,11 +84,17 @@ IMPLEMENT_READING(QTapReading)
the detected axis. Previous versions of the API did not allow this. Applications that check
for the _Pos and _Neg flags as values should be updated so they can work with all devices.
- \oldcode
+ For example, if you have code like
+
+ \code
if (reading->tapDirection() == QTapReading::X_Pos) {
...
}
- \newcode
+ \endcode
+
+ you can rewrite it as
+
+ \code
if (reading->tapDirection()&QTapReading::X_Pos) {
...
}
diff --git a/src/sensorsquick/CMakeLists.txt b/src/sensorsquick/CMakeLists.txt
index 304504a2..00aa7b46 100644
--- a/src/sensorsquick/CMakeLists.txt
+++ b/src/sensorsquick/CMakeLists.txt
@@ -33,4 +33,6 @@ qt_internal_add_qml_module(SensorsQuick
Qt::Sensors
LIBRARIES
Qt::CorePrivate
+ GENERATE_CPP_EXPORTS
+ GENERATE_PRIVATE_CPP_EXPORTS
)
diff --git a/src/sensorsquick/qmlaccelerometer.cpp b/src/sensorsquick/qmlaccelerometer.cpp
index f6f4ec11..b0789e2b 100644
--- a/src/sensorsquick/qmlaccelerometer.cpp
+++ b/src/sensorsquick/qmlaccelerometer.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype Accelerometer
- \instantiates QmlAccelerometer
+//! \instantiates QmlAccelerometer
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -102,7 +102,7 @@ QSensor *QmlAccelerometer::sensor() const
/*!
\qmltype AccelerometerReading
- \instantiates QmlAccelerometerReading
+//! \instantiates QmlAccelerometerReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlambientlightsensor.cpp b/src/sensorsquick/qmlambientlightsensor.cpp
index 0dbe9157..bf751821 100644
--- a/src/sensorsquick/qmlambientlightsensor.cpp
+++ b/src/sensorsquick/qmlambientlightsensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype AmbientLightSensor
- \instantiates QmlAmbientLightSensor
+//! \instantiates QmlAmbientLightSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -79,7 +79,7 @@ QSensor *QmlAmbientLightSensor::sensor() const
/*!
\qmltype AmbientLightReading
- \instantiates QmlAmbientLightSensorReading
+//! \instantiates QmlAmbientLightSensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlambienttemperaturesensor.cpp b/src/sensorsquick/qmlambienttemperaturesensor.cpp
index 652b45d8..15c23cb2 100644
--- a/src/sensorsquick/qmlambienttemperaturesensor.cpp
+++ b/src/sensorsquick/qmlambienttemperaturesensor.cpp
@@ -41,7 +41,7 @@
/*!
\qmltype AmbientTemperatureSensor
- \instantiates QmlAmbientTemperatureSensor
+//! \instantiates QmlAmbientTemperatureSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.1
@@ -78,7 +78,7 @@ QSensor *QmlAmbientTemperatureSensor::sensor() const
/*!
\qmltype AmbientTemperatureReading
- \instantiates QmlAmbientTemperatureReading
+//! \instantiates QmlAmbientTemperatureReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.1
diff --git a/src/sensorsquick/qmlcompass.cpp b/src/sensorsquick/qmlcompass.cpp
index d5f12b19..ac9725b3 100644
--- a/src/sensorsquick/qmlcompass.cpp
+++ b/src/sensorsquick/qmlcompass.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype Compass
- \instantiates QmlCompass
+//! \instantiates QmlCompass
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -79,7 +79,7 @@ QSensor *QmlCompass::sensor() const
/*!
\qmltype CompassReading
- \instantiates QmlCompassReading
+//! \instantiates QmlCompassReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlgyroscope.cpp b/src/sensorsquick/qmlgyroscope.cpp
index 7654805a..62ae5cbe 100644
--- a/src/sensorsquick/qmlgyroscope.cpp
+++ b/src/sensorsquick/qmlgyroscope.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype Gyroscope
- \instantiates QmlGyroscope
+//! \instantiates QmlGyroscope
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -78,7 +78,7 @@ QSensor *QmlGyroscope::sensor() const
/*!
\qmltype GyroscopeReading
- \instantiates QmlGyroscopeReading
+//! \instantiates QmlGyroscopeReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlhumiditysensor.cpp b/src/sensorsquick/qmlhumiditysensor.cpp
index ad7aa6de..0c5aef84 100644
--- a/src/sensorsquick/qmlhumiditysensor.cpp
+++ b/src/sensorsquick/qmlhumiditysensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype HumiditySensor
- \instantiates QmlHumiditySensor
+//! \instantiates QmlHumiditySensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.9
@@ -79,7 +79,7 @@ QSensor *QmlHumiditySensor::sensor() const
/*!
\qmltype HumidityReading
- \instantiates QmlHumidityReading
+//! \instantiates QmlHumidityReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.9
diff --git a/src/sensorsquick/qmlirproximitysensor.cpp b/src/sensorsquick/qmlirproximitysensor.cpp
index bcc24937..2e44fb77 100644
--- a/src/sensorsquick/qmlirproximitysensor.cpp
+++ b/src/sensorsquick/qmlirproximitysensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype IRProximitySensor
- \instantiates QmlIRProximitySensor
+//! \instantiates QmlIRProximitySensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -78,7 +78,7 @@ QSensor *QmlIRProximitySensor::sensor() const
/*!
\qmltype IRProximityReading
- \instantiates QmlIRProximitySensorReading
+//! \instantiates QmlIRProximitySensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmllidsensor.cpp b/src/sensorsquick/qmllidsensor.cpp
index 0ec4a17f..293d77a2 100644
--- a/src/sensorsquick/qmllidsensor.cpp
+++ b/src/sensorsquick/qmllidsensor.cpp
@@ -41,7 +41,7 @@
/*!
\qmltype LidSensor
- \instantiates QmlLidSensor
+//! \instantiates QmlLidSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.9
@@ -79,7 +79,7 @@ QSensor *QmlLidSensor::sensor() const
/*!
\qmltype LidReading
- \instantiates QmlLidReading
+//! \instantiates QmlLidReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.9
diff --git a/src/sensorsquick/qmllightsensor.cpp b/src/sensorsquick/qmllightsensor.cpp
index 9761fe47..7bcc3dad 100644
--- a/src/sensorsquick/qmllightsensor.cpp
+++ b/src/sensorsquick/qmllightsensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype LightSensor
- \instantiates QmlLightSensor
+//! \instantiates QmlLightSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -93,7 +93,7 @@ qreal QmlLightSensor::fieldOfView() const
/*!
\qmltype LightReading
- \instantiates QmlLightSensorReading
+//! \instantiates QmlLightSensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlmagnetometer.cpp b/src/sensorsquick/qmlmagnetometer.cpp
index b228360e..d9e4c8f9 100644
--- a/src/sensorsquick/qmlmagnetometer.cpp
+++ b/src/sensorsquick/qmlmagnetometer.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype Magnetometer
- \instantiates QmlMagnetometer
+//! \instantiates QmlMagnetometer
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -100,7 +100,7 @@ void QmlMagnetometer::setReturnGeoValues(bool geo)
/*!
\qmltype MagnetometerReading
- \instantiates QmlMagnetometerReading
+//! \instantiates QmlMagnetometerReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlorientationsensor.cpp b/src/sensorsquick/qmlorientationsensor.cpp
index 50e5ea2e..a35148d4 100644
--- a/src/sensorsquick/qmlorientationsensor.cpp
+++ b/src/sensorsquick/qmlorientationsensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype OrientationSensor
- \instantiates QmlOrientationSensor
+//! \instantiates QmlOrientationSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -79,7 +79,7 @@ QSensor *QmlOrientationSensor::sensor() const
/*!
\qmltype OrientationReading
- \instantiates QmlOrientationSensorReading
+//! \instantiates QmlOrientationSensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlpressuresensor.cpp b/src/sensorsquick/qmlpressuresensor.cpp
index 285d321c..e7ac76f6 100644
--- a/src/sensorsquick/qmlpressuresensor.cpp
+++ b/src/sensorsquick/qmlpressuresensor.cpp
@@ -41,7 +41,7 @@
/*!
\qmltype PressureSensor
- \instantiates QmlPressureSensor
+//! \instantiates QmlPressureSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.1
@@ -78,7 +78,7 @@ QSensor *QmlPressureSensor::sensor() const
/*!
\qmltype PressureReading
- \instantiates QmlPressureReading
+//! \instantiates QmlPressureReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.1
diff --git a/src/sensorsquick/qmlproximitysensor.cpp b/src/sensorsquick/qmlproximitysensor.cpp
index c45bc7bb..2408017f 100644
--- a/src/sensorsquick/qmlproximitysensor.cpp
+++ b/src/sensorsquick/qmlproximitysensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype ProximitySensor
- \instantiates QmlProximitySensor
+//! \instantiates QmlProximitySensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -79,7 +79,7 @@ QSensor *QmlProximitySensor::sensor() const
/*!
\qmltype ProximityReading
- \instantiates QmlProximitySensorReading
+//! \instantiates QmlProximitySensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlrotationsensor.cpp b/src/sensorsquick/qmlrotationsensor.cpp
index be453a87..9e56a0a5 100644
--- a/src/sensorsquick/qmlrotationsensor.cpp
+++ b/src/sensorsquick/qmlrotationsensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype RotationSensor
- \instantiates QmlRotationSensor
+//! \instantiates QmlRotationSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -94,7 +94,7 @@ bool QmlRotationSensor::hasZ() const
/*!
\qmltype RotationReading
- \instantiates QmlRotationSensorReading
+//! \instantiates QmlRotationSensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmlsensor.cpp b/src/sensorsquick/qmlsensor.cpp
index c722343f..16e6bdc4 100644
--- a/src/sensorsquick/qmlsensor.cpp
+++ b/src/sensorsquick/qmlsensor.cpp
@@ -75,7 +75,7 @@ QQmlListProperty<Item> readonlyListProperty(const QObject *o, const QList<Item *
/*!
\qmltype Sensor
- \instantiates QmlSensor
+//! \instantiates QmlSensor
\inqmlmodule QtSensors
\since QtSensors 5.0
\brief The Sensor element serves as a base type for sensors.
@@ -510,7 +510,7 @@ void QmlSensor::updateReading()
/*!
\qmltype SensorReading
- \instantiates QmlSensorReading
+//! \instantiates QmlSensorReading
\inqmlmodule QtSensors
\since QtSensors 5.0
\brief The SensorReading element serves as a base type for sensor readings.
diff --git a/src/sensorsquick/qmlsensor_p.h b/src/sensorsquick/qmlsensor_p.h
index 801934dc..edb31441 100644
--- a/src/sensorsquick/qmlsensor_p.h
+++ b/src/sensorsquick/qmlsensor_p.h
@@ -54,6 +54,7 @@
#include "qsensorsquickglobal_p.h"
#include <QObject>
+#include <QProperty>
#include <QQmlParserStatus>
#include <QtQml/qqml.h>
#include <QQmlListProperty>
diff --git a/src/sensorsquick/qmlsensorglobal.cpp b/src/sensorsquick/qmlsensorglobal.cpp
index 0bf67d4e..3d2a8908 100644
--- a/src/sensorsquick/qmlsensorglobal.cpp
+++ b/src/sensorsquick/qmlsensorglobal.cpp
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype QmlSensors
- \instantiates QmlSensorGlobal
+//! \instantiates QmlSensorGlobal
\inqmlmodule QtSensors
\since QtSensors 5.0
\brief The QmlSensors singleton provides the module API.
diff --git a/src/sensorsquick/qmltapsensor.cpp b/src/sensorsquick/qmltapsensor.cpp
index 90a08de0..8aed2c15 100644
--- a/src/sensorsquick/qmltapsensor.cpp
+++ b/src/sensorsquick/qmltapsensor.cpp
@@ -42,7 +42,7 @@
/*!
\qmltype TapSensor
- \instantiates QmlTapSensor
+//! \instantiates QmlTapSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -101,7 +101,7 @@ void QmlTapSensor::setReturnDoubleTapEvents(bool ret)
/*!
\qmltype TapReading
- \instantiates QmlTapSensorReading
+//! \instantiates QmlTapSensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qmltiltsensor.cpp b/src/sensorsquick/qmltiltsensor.cpp
index 4912c9f1..2061465d 100644
--- a/src/sensorsquick/qmltiltsensor.cpp
+++ b/src/sensorsquick/qmltiltsensor.cpp
@@ -45,7 +45,7 @@ QT_END_NAMESPACE
/*!
\qmltype TiltSensor
- \instantiates QmlTiltSensor
+//! \instantiates QmlTiltSensor
\ingroup qml-sensors_type
\inqmlmodule QtSensors
\since QtSensors 5.0
@@ -94,7 +94,7 @@ void QmlTiltSensor::calibrate()
/*!
\qmltype TiltReading
- \instantiates QmlTiltSensorReading
+//! \instantiates QmlTiltSensorReading
\ingroup qml-sensors_reading
\inqmlmodule QtSensors
\since QtSensors 5.0
diff --git a/src/sensorsquick/qsensorsquickglobal_p.h b/src/sensorsquick/qsensorsquickglobal_p.h
index 4f6034f6..9afe14d9 100644
--- a/src/sensorsquick/qsensorsquickglobal_p.h
+++ b/src/sensorsquick/qsensorsquickglobal_p.h
@@ -52,22 +52,7 @@
//
#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#if !defined(QT_STATIC)
-# if defined(QT_BUILD_SENSORSQUICK_LIB)
-# define Q_SENSORSQUICK_EXPORT Q_DECL_EXPORT
-# else
-# define Q_SENSORSQUICK_EXPORT Q_DECL_IMPORT
-# endif
-#else
-# define Q_SENSORSQUICK_EXPORT
-#endif
-
-#define Q_SENSORSQUICK_PRIVATE_EXPORT Q_SENSORSQUICK_EXPORT
-
-QT_END_NAMESPACE
+#include <QtSensorsQuick/private/qtsensorsquickexports_p.h>
void Q_SENSORSQUICK_PRIVATE_EXPORT qml_register_types_QtSensors();