summaryrefslogtreecommitdiffstats
path: root/doc/src/qmlapp
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-08-31 17:54:22 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2021-09-01 09:35:37 +0200
commit5d32ab418948b9a595cb811c70fe308297ae5d0f (patch)
tree53687f7a37280b11b7fabc70e3bec02bf3a76e5c /doc/src/qmlapp
parent31a4371d6e018d738ad2155bc1b5143a656fd958 (diff)
qmlapp/codingconventions: Recommend using type annotations
Pick-to: 6.2 Task-number: QTBUG-96150 Change-Id: Iaeaff2558935ca1008fb19416ec4852b6ee51549 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'doc/src/qmlapp')
-rw-r--r--doc/src/qmlapp/codingconventions.qdoc4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/src/qmlapp/codingconventions.qdoc b/doc/src/qmlapp/codingconventions.qdoc
index e17c48280..6fc7b67d7 100644
--- a/doc/src/qmlapp/codingconventions.qdoc
+++ b/doc/src/qmlapp/codingconventions.qdoc
@@ -102,6 +102,10 @@ If the script is more than a couple of lines long or can be used by different ob
\snippet qmlapp/codingconventions/javascript.qml 2
+Also note that is recommended to add type annotations to your function in order
+to more easily reason about and refactor your application since both parameter
+and return types are immediately visible from the function signature.
+
For long scripts, we will put the functions in their own JavaScript file and import it like this:
\snippet qmlapp/codingconventions/javascript-imports.qml 0