diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-19 10:49:56 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-24 09:34:11 +0100 |
commit | 2570b801c74832a3c83a8b56ad0f76812969e190 (patch) | |
tree | c4bd64d8e6b15b507f51f550ba13a0c062528d65 /src/qml/doc/src/qmllanguageref/syntax | |
parent | 1b96186d1418adcba85fdbfd794da2d2f6ea122d (diff) | |
parent | 706a6647db695cdeb854ef1bf956ded56b498f78 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
.qmake.conf
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/debugger/qqmlprofiler_p.h
src/qml/jsruntime/qv4engine.cpp
src/qml/memory/qv4mm.cpp
src/qml/qml/qqmlcomponent.cpp
src/qml/qml/qqmlobjectcreator.cpp
src/qml/qml/qqmlobjectcreator_p.h
src/qml/types/qqmldelegatemodel.cpp
src/quick/items/qquickitem_p.h
src/quick/items/qquickwindow.cpp
tests/auto/quick/touchmouse/BLACKLIST
tests/benchmarks/qml/holistic/tst_holistic.cpp
Change-Id: I520f349ab4b048dd337d9647113564fc257865c2
Diffstat (limited to 'src/qml/doc/src/qmllanguageref/syntax')
-rw-r--r-- | src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index 207fb53ca0..31650db7c0 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -449,13 +449,38 @@ right-hand-side of the property declaration must be a valid alias reference: [default] property alias <name>: <alias reference> \endcode -Unlike an ordinary property, an alias can only refer to an object, or the -property of an object, that is within the scope of the \l{QML Object Types} -{type} within which the alias is declared. It cannot contain arbitrary -JavaScript expressions and it cannot refer to objects declared outside of -the scope of its type. Also note the \e {alias reference} is not optional, -unlike the optional default value for an ordinary property; the alias reference -must be provided when the alias is first declared. +Unlike an ordinary property, an alias has the following restrictions: + +\list +\li It can only refer to an object, or the + property of an object, that is within the scope of the \l{QML Object Types} + {type} within which the alias is declared. +\li It cannot contain arbitrary + JavaScript expressions +\li It cannot refer to objects declared outside of + the scope of its type. +\li The \e {alias reference} is not optional, + unlike the optional default value for an ordinary property; the alias reference + must be provided when the alias is first declared. +\li It cannot refer to grouped properties; the following code will not work: + \code + property alias color: rectangle.border.color + + Rectangle { + id: rectangle + } + \endcode + + However, aliases to \l {QML Basic Types}{value type} properties do work: + \code + property alias rectX: object.rectProperty.x + + Item { + id: object + property rect rectProperty + } + \endcode +\endlist For example, below is a \c Button type with a \c buttonText aliased property which is connected to the \c text object of the \l Text child: |