summaryrefslogtreecommitdiffstats
path: root/src/sensors/doc/src/qtsensors-tutorial.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sensors/doc/src/qtsensors-tutorial.qdoc')
-rw-r--r--src/sensors/doc/src/qtsensors-tutorial.qdoc36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/sensors/doc/src/qtsensors-tutorial.qdoc b/src/sensors/doc/src/qtsensors-tutorial.qdoc
new file mode 100644
index 00000000..147b8504
--- /dev/null
+++ b/src/sensors/doc/src/qtsensors-tutorial.qdoc
@@ -0,0 +1,36 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtsensors-tutorial.html
+ \title How to create your own Sensor
+ \brief Steps for creating your own sensors
+
+ The Qt Sensors module provides access to sensor hardware via QML and C++
+ interfaces.
+
+ The API is supported on \l{Qt for Android}{Android}, \l{Qt for iOS}{iOS}, and
+ \l {Qt for Windows}{Windows (MSVC)}.
+
+ \section1 Creating your own sensor using C++ API
+
+ Using a Qt module's C++ API requires linking against the module library, either
+ directly or through other dependencies.
+ \section2 Creating a sensor
+
+ To create your own sensor you can use the following steps:
+
+ \list
+ \li Create your own MySensor and MySensorReading classes
+ \snippet sensors/tutorial.cpp MySensor
+ \li Create a MySensorBackend by inheriting from QSensorBackend
+ \li Create MySensorBackendFactory factory class for instantiating that
+ backend by inheriting a class QSensorBackendFactory
+ \li Register the backend factory by calling
+ QSensorManager::registerBackend ("MySensorType", "MySensorId", &myfactory)
+ \li Instantiate the new MySensor and start using it
+ \endlist
+
+ As an another option the sensors are put into a \l {Creating a sensor plugin}
+ that you can use on demand.
+*/