diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-08-03 15:51:06 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-03 08:42:56 +0200 |
commit | aa77184cb892cf4b3cd767f4e14fff393efe896f (patch) | |
tree | a56d8ecf3719f945b1d737fc42994c6b6d99cf72 /doc/src/snippets | |
parent | 5084c274aac111db3f5f0c38258aa06aa9448bda (diff) |
Add some guidelines for declaring objects as properties of Components.
Task-number: QTBUG-20198
Change-Id: Id8ba8901be6c4f06974d1afd32f1932f867e2544
Reviewed-on: http://codereview.qt.nokia.com/2540
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/declarative/reusablecomponents/Button.qml | 7 | ||||
-rw-r--r-- | doc/src/snippets/declarative/reusablecomponents/application.qml | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/doc/src/snippets/declarative/reusablecomponents/Button.qml b/doc/src/snippets/declarative/reusablecomponents/Button.qml index 3b97e00952..6a0567ec99 100644 --- a/doc/src/snippets/declarative/reusablecomponents/Button.qml +++ b/doc/src/snippets/declarative/reusablecomponents/Button.qml @@ -51,6 +51,9 @@ Rectangle { smooth: true; radius: 9 property alias text: label.text //! [properties] +//! [object alias] + property alias label: label +//! [object alias] border {color: "#B9C5D0"; width: 1} gradient: Gradient { @@ -58,7 +61,7 @@ Rectangle { GradientStop {color: "#99C0E5"; position: 0.57} GradientStop {color: "#719FCB"; position: 0.9} } - +//![text] Text { id: label anchors.centerIn: parent @@ -66,7 +69,7 @@ Rectangle { font.pointSize: 12 color: "blue" } - +//![text] MouseArea { anchors.fill: parent onClicked: console.log(text + " clicked") diff --git a/doc/src/snippets/declarative/reusablecomponents/application.qml b/doc/src/snippets/declarative/reusablecomponents/application.qml index a09b276b73..4fd8ed2bf6 100644 --- a/doc/src/snippets/declarative/reusablecomponents/application.qml +++ b/doc/src/snippets/declarative/reusablecomponents/application.qml @@ -50,6 +50,9 @@ Rectangle { Button {} Button {text: "Me Too!"} Button {text: "Me Three!"} +//! [grouped property] + Button {label.color: "green"} +//! [grouped property] } } //! [document] |