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?
16Multiple properties in the same QML component scope have the same name.
17
18\section2 Why is this bad?
19Components with duplicate property names will not be created at runtime: they will be null instead.
20
21\section2 Example
22\qml
23import QtQuick
24
25Item {
26 property int helloWorld
27 property int helloWorld
28}
29\endqml
30To fix this warning, remove the duplicate property or rename it:
31\qml
32import QtQuick
33
34Item {
35 property int helloWorld
36}
37\endqml
38
39\section1 Duplicated signal name
40
41\section2 What happened?
42Multiple signals in the same QML component scope have the same name.
43
44\section2 Why is this bad?
45Components with duplicate signal names will not be created at runtime: they will be null instead.
46
47\section2 Example
48\qml
49import QtQuick
50
51Rectangle {
52 signal helloWorld
53 signal helloWorld
54}
55\endqml
56To fix this warning, remove the duplicate signal or rename it:
57\qml
58import QtQuick
59
60Rectangle {
61 signal helloWorld
62}
63
64\endqml
65*/