Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
duplicated-name.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2023 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qmllint-warnings-and-errors-duplicated-name.html
6
\ingroup qmllint-warnings-and-errors
7
8
\title Duplicated name
9
\brief [duplicated-name] Multiple signals or properties share the same name in the same Component.
10
11
\qmllintwarningcategory duplicated-name
12
13
\section1 Duplicated Property Name
14
15
\section2 What happened?
16
Multiple properties in the same QML component scope have the same name.
17
18
\section2 Why is this bad?
19
Components with duplicate property names will not be created at runtime: they will be null instead.
20
21
\section2 Example
22
\qml
23
import QtQuick
24
25
Item {
26
property int helloWorld
27
property int helloWorld
28
}
29
\endqml
30
To fix this warning, remove the duplicate property or rename it:
31
\qml
32
import QtQuick
33
34
Item {
35
property int helloWorld
36
}
37
\endqml
38
39
\section1 Duplicated signal name
40
41
\section2 What happened?
42
Multiple signals in the same QML component scope have the same name.
43
44
\section2 Why is this bad?
45
Components with duplicate signal names will not be created at runtime: they will be null instead.
46
47
\section2 Example
48
\qml
49
import QtQuick
50
51
Rectangle {
52
signal helloWorld
53
signal helloWorld
54
}
55
\endqml
56
To fix this warning, remove the duplicate signal or rename it:
57
\qml
58
import QtQuick
59
60
Rectangle {
61
signal helloWorld
62
}
63
64
\endqml
65
*/
qtdeclarative
src
qml
doc
src
qmllint
duplicated-name.qdoc
Generated on
for Qt by
1.14.0