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