summaryrefslogtreecommitdiffstats
path: root/examples/sensors/maze/doc/src/maze.qdoc
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-06-29 16:26:12 +0300
committerJuha Vuolle <juha.vuolle@insta.fi>2021-07-02 09:19:08 +0300
commitd28e4c588ba454001299b99183576f6b3b0b38b8 (patch)
tree499e8c9fb75101788b3f346041e70df2b2588b13 /examples/sensors/maze/doc/src/maze.qdoc
parent455e5a973be5f7c3afaff147f4482a69d134b5bd (diff)
Improve QtSensors maze example application
The original problem was that the example accesses tilt sensor readings even if such sensor is not present, which yields errors. In addition to fixing that, few other concerns are addressed as well. As a summary: - show a screen blocker if tilt sensor is not found - run tilt read / game timer only when the game is running - display the tilt sensor identifier - remove the use of nonexistent TiltSensor::enabled property - separate initial element instantiation from new game generation - remove unnecessary start timer - log dynamic element creation errors, and remove unnecessary component 'ready' checks (as only local QML is used) Pick-to: 6.2 Task-number: QTBUG-72328 Task-number: QTBUG-92514 Change-Id: I6a1589297c3c34b85e2876ede52eab31e07dd950 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'examples/sensors/maze/doc/src/maze.qdoc')
-rw-r--r--examples/sensors/maze/doc/src/maze.qdoc18
1 files changed, 8 insertions, 10 deletions
diff --git a/examples/sensors/maze/doc/src/maze.qdoc b/examples/sensors/maze/doc/src/maze.qdoc
index 2cc69644..57e75955 100644
--- a/examples/sensors/maze/doc/src/maze.qdoc
+++ b/examples/sensors/maze/doc/src/maze.qdoc
@@ -35,29 +35,27 @@
\brief The Maze example demonstrates the TiltSensor QML type.
- To write a QML application that will use the TiltSensor QML sensors type you need to do the following steps:
+ To write a QML application that will use the TiltSensor QML sensors type
+ you need to do the following steps:
- Import the QtSensors 5.x declarative plugin:
+ To import the Qt Sensors QML types into your application, use the following
+ import statement in your .qml file:
\snippet maze/maze.qml 0
- Add the Sensor QML types into your qml file.
+ Then, add the Sensor QML types into your qml file.
- In this example we use the TiltSensor with values based in degrees and an accuracy of 5 degree:
+ In this example we use the TiltSensor:
\snippet maze/maze.qml 1
- Starting the sensor can be done by setting the 'enabled' property to true:
-
- \snippet maze/maze.qml 2
-
The mouse should move by a factor of the tilt value:
- \snippet maze/maze.qml 3
+ \snippet maze/maze.qml 2
The walk direction of the mouse takes into account some collision detection:
- \snippet maze/maze.qml 4
+ \snippet maze/maze.qml 3
The rotation of the mouse image is determined according to the angle that the mouse is moving.