diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-10-15 08:14:12 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-10-21 14:38:32 +0200 |
commit | 488a37c861a1724a935a8d7b925693a38918a71a (patch) | |
tree | 2c57e05ffc540d294035c69df038620b3c16c349 /src/qml/doc/src | |
parent | 82793cdc229c225494cc7e64d6351321c2442a23 (diff) |
Document recent change in allowed alias usage
This amends e5f3e7149b7e130c375c1419f1f804dfeaf578aa
Task-number: QTBUG-48150
Change-Id: I64c7426143c82d6ee45b07a40e961b7b7c1faf16
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/doc/src')
-rw-r--r-- | src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index c4ecaf367c..401e099ebf 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -464,22 +464,24 @@ Unlike an ordinary property, an alias has the following restrictions: must be provided when the alias is first declared. \li It cannot refer to \l {Attached Properties and Attached Signal Handlers} {attached properties}. -\li It cannot refer to grouped properties; the following code will not work: +\li It cannot refer to properties inside a hierarchy with depth 3 or greater. The + following code will not work: \code - property alias color: rectangle.border.color + property alias color: myItem.myRect.border.color - Rectangle { - id: rectangle + Item { + id: myItem + property Rectangle myRect } \endcode - However, aliases to \l {QML Basic Types}{value type} properties do work: + However, aliases to properties that are up to two levels deep will work. + \code - property alias rectX: object.rectProperty.x + property alias color: rectangle.border.color - Item { - id: object - property rect rectProperty + Rectangle { + id: rectangle } \endcode \endlist |