diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-07-30 03:01:23 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-07-30 03:01:23 (GMT) |
commit | 765c263d538b258f223dfb6bd7f62dbd19853db6 (patch) | |
tree | e123e3b4245358ac21623faa3e3d97bd5e75f3c0 /doc | |
parent | eef2e72976f3f8d10a34c9dfb3f60f40616f4df9 (diff) | |
download | Qt-765c263d538b258f223dfb6bd7f62dbd19853db6.zip Qt-765c263d538b258f223dfb6bd7f62dbd19853db6.tar.gz Qt-765c263d538b258f223dfb6bd7f62dbd19853db6.tar.bz2 |
Mention scope of id uniqueness
Task-number: QTBUG-12528
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/declarative/qdeclarativedocument.qdoc | 4 | ||||
-rw-r--r-- | doc/src/declarative/qdeclarativeintro.qdoc | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/src/declarative/qdeclarativedocument.qdoc b/doc/src/declarative/qdeclarativedocument.qdoc index f12e547..068297a 100644 --- a/doc/src/declarative/qdeclarativedocument.qdoc +++ b/doc/src/declarative/qdeclarativedocument.qdoc @@ -73,6 +73,10 @@ document - such as \c Rectangle and \c ListView - including those made within an import statements. QML does not import any modules by default, so at least one \c import statement must be present or no elements will be available! +Each \c id value in a QML document must be unique within that document. They +do not need to be unique across different documents as id values are +resolved according to the document scope. + \section1 Documents as Component Definitions diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc index 75055d8..fa42f59 100644 --- a/doc/src/declarative/qdeclarativeintro.qdoc +++ b/doc/src/declarative/qdeclarativeintro.qdoc @@ -87,6 +87,10 @@ Rectangle { width: 100; height: 100 } When multiple property/value pairs are specified on a single line, they must be separated by a semicolon. +The \c import statement imports the \c Qt \l{QML Modules}{module}, which contains all of the +standard \l {QML Elements}. Without this import statement, the \l Rectangle +and \l Image elements would not be available. + \section1 Expressions In addition to assigning values to properties, you can also assign @@ -181,7 +185,8 @@ Item { \section3 The \c id property -Each object can be given a special unique property called an \e id. Assigning an id enables the object +Each object can be given a special unique property called an \e id. No other object within the +same \l{QML Documents}{QML document} can have the same \c id value. 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 |