aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc
diff options
context:
space:
mode:
authorSami Shalayel <sami.shalayel@qt.io>2023-10-13 15:39:29 +0200
committerSami Shalayel <sami.shalayel@qt.io>2023-10-23 08:11:07 +0200
commit425b35d88737ec2d3ef3198a7265702827610a65 (patch)
treec1acb4171d30460614dd696ead60c8063787fcb6 /src/qml/doc
parente673d4d38b0faaf822306f944140151480969eb9 (diff)
doc: add duplicated-name warning in qmllint warnings
Add description of the warning and an example on how to fix it. Task-number: QTBUG-111137 Change-Id: I8ee0d31e9562cdbd963e5bdf25fe75fdce7b3190 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/doc')
-rw-r--r--src/qml/doc/src/qmllint/duplicated-name.qdoc56
1 files changed, 50 insertions, 6 deletions
diff --git a/src/qml/doc/src/qmllint/duplicated-name.qdoc b/src/qml/doc/src/qmllint/duplicated-name.qdoc
index 192d9868d7..0cc4583cb4 100644
--- a/src/qml/doc/src/qmllint/duplicated-name.qdoc
+++ b/src/qml/doc/src/qmllint/duplicated-name.qdoc
@@ -5,22 +5,66 @@
\page qmllint-warnings-and-errors-duplicated-name.html
\ingroup qmllint-warnings-and-errors
-\title duplicated-name
-\brief BRIEF
+\title Duplicated Name
+\brief Multiple signals or properties share the same name in the same Component.
-\section1 duplicated-name
+This warning category has multiple warnings:
+\list
+ \li \l{Duplicated Property Name}
+ \li \l{Duplicated Signal Name}
+\endlist
+
+\section1 Duplicated Property Name
\section2 What happened?
-TODO
+Multiple properties in the same QML component scope have the same name.
\section2 Why is this bad?
-TODO
+Components with duplicate property names will not be created at runtime: they will be null instead.
\section2 Example
\qml
+import QtQuick
+
+Item {
+ property int helloWorld
+ property int helloWorld
+}
\endqml
-You can fix this warning by TODO
+You can fix this warning by removing the duplicate property or renaming it:
\qml
+import QtQuick
+
+Item {
+ property int helloWorld
+}
+\endqml
+
+\section1 Duplicated Signal Name
+
+\section2 What happened?
+Multiple signals in the same QML component scope have the same name.
+
+\section2 Why is this bad?
+Components with duplicate signal names will not be created at runtime: they will be null instead.
+
+\section2 Example
+\qml
+import QtQuick
+
+Rectangle {
+ signal helloWorld
+ signal helloWorld
+}
+\endqml
+You can fix this warning by removing the duplicate signal or renaming it:
+\qml
+import QtQuick
+
+Rectangle {
+ signal helloWorld
+}
+
\endqml
*/