W3cubDocs

/Qt 6.9

Id quotation

This warning category is spelled [syntax.id-quotation] by qmllint.

Ids do not need quotation marks

What happened?

You surrounded an id with quotation marks.

Why is this bad?

This might lead to confusion between ids and strings. The QML language does not require quotation marks for ids and forbids more complex string expressions for ids.

Example

import QtQuick

Item {
    id: "root"
}

To fix this warning, remove the quotation marks:

import QtQuick

Item {
    id: root
}

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.9/qmllint-warnings-and-errors-syntax-id-quotation.html