diff options
Diffstat (limited to 'doc/src/declarative/qmlintro.qdoc')
-rw-r--r-- | doc/src/declarative/qmlintro.qdoc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/doc/src/declarative/qmlintro.qdoc b/doc/src/declarative/qmlintro.qdoc index 8141c90..3891515 100644 --- a/doc/src/declarative/qmlintro.qdoc +++ b/doc/src/declarative/qmlintro.qdoc @@ -192,22 +192,29 @@ Item { \section3 The \c id property -The \c id property is a special property of type \e id. Assigning an id to an object allows you -to refer to it elsewhere. +Each object can be given a special unique property called an \e id. Assigning an id enables the object +to be referred to by other objects and scripts. + +The first Rectangle element below has an \e id, "myRect". The second Rectange element defines its +own width by referring to \tt myRect.width, which means it will have the same \tt width +value as the first Rectangle element. \code Item { - Text { - id: myName - text: "..." + Rectangle { + id: myRect + width: 100 + height: 100 } - Text { - text: myName.text + Rectangle { + width: myRect.width + height: 200 } } \endcode -\c Ids must begin with a lowercase letter. +Note that an \e id must begin with a lower-case letter or an underscore, and cannot contain characters other than letters, numbers and underscores. + \section2 List properties |