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
syntax.id-quotation.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
\ingroup qmllint-warnings-and-errors
6
7
\title Id quotation
8
\brief [syntax.id-quotation] Id has quotation marks.
9
10
\qmllintwarningcategory syntax.id-quotation
11
12
\section1 Ids do not need quotation marks
13
14
\section2 What happened?
15
You surrounded an \l{qtqml-syntax-objectattributes.html#the-id-attribute}{id}
16
with quotation marks.
17
18
\section2 Why is this bad?
19
This might lead to confusion between ids and strings.
20
The QML language does not require quotation marks for ids and
21
forbids more complex string expressions for ids.
22
23
\section2 Example
24
\qml
25
import QtQuick
26
27
Item {
28
id: "root"
29
}
30
31
\endqml
32
To fix this warning, remove the quotation marks:
33
\qml
34
import QtQuick
35
36
Item {
37
id: root
38
}
39
\endqml
40
*/
qtdeclarative
src
qml
doc
src
qmllint
syntax.id-quotation.qdoc
Generated on
for Qt by
1.16.1