diff options
Diffstat (limited to 'src/qml/doc')
-rw-r--r-- | src/qml/doc/src/qmllint/unresolved-alias.qdoc | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/qml/doc/src/qmllint/unresolved-alias.qdoc b/src/qml/doc/src/qmllint/unresolved-alias.qdoc index 38518c3089..63b02613dd 100644 --- a/src/qml/doc/src/qmllint/unresolved-alias.qdoc +++ b/src/qml/doc/src/qmllint/unresolved-alias.qdoc @@ -5,22 +5,46 @@ \page qmllint-warnings-and-errors-unresolved-alias.html \ingroup qmllint-warnings-and-errors -\title unresolved-alias -\brief BRIEF +\title Unresolved Alias +\brief Property of property alias was not found. -\section1 unresolved-alias +\section1 Unresolved Alias \section2 What happened? -TODO +A property alias should hold a reference to another property, see also +\l{QML Object Attributes#property-aliases}{QML Object Attributes - Property Aliases}. +In this case, it holds a reference to a property that was not found. \section2 Why is this bad? -TODO +Instances of components with unresolved alias will not be created at runtime: +they will be null instead. \section2 Example \qml +import QtQuick + +Item { + id: someId + property int helloWorld + + property alias helloWorldAlias: helloWorld // not ok: aliases have to refer by id + property alias helloWorldAlias2: someId.helloWorlddd // not ok: no helloWorlddd in someId + property alias helloWorldAlias3: someIddd.helloWorld // not ok: someIddd does not exist +} + \endqml -You can fix this warning by TODO +You can fix this warning by making sure that the id and the properties of the alias property +really do exist: \qml +import QtQuick + +Item { + id: someId + property int helloWorld + + property alias helloWorldAlias: someId.helloWorld // ok: alias refers by id + property alias helloWorldAlias2: someId.helloWorld // ok: helloWorld does exist in someId + property alias helloWorldAlias3: someId.helloWorld // ok: someId does exist +} \endqml */ - |