1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5\page qmllint-warnings-and-errors-unqualified.html
6\ingroup qmllint-warnings-and-errors
8\title Unqualified Access
9\brief Accessing an outer scope without its id.
11\section1 Unqualified Access
13\section2 What happened?
15A parent element was accessed without its \l{QML Object Attributes#the-id-attribute}{id}.
17\section2 Why is this bad?
19This makes the code harder to read and impedes performance.
27 property int helloWorld
29 property int unqualifiedAccess: helloWorld + 1 // not ok: Unqualified access here.
34You can fix this warning by referring to the parent object by
35\l{QML Object Attributes#the-id-attribute}{id}.
36If the object currently has no \l{QML Object Attributes#the-id-attribute}{id}, you will need to add
44 property int helloWorld
46 property int unqualifiedAccess: root.helloWorld + 1 // ok: this access is qualified now!
51\sa {QML Coding Conventions#unqualified-access}{QML Coding Conventions - Unqualified Access}