summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-02-03 00:01:13 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-02-03 00:04:03 (GMT)
commit17d0ed5af4922645a268b6550742fb521d459c8e (patch)
tree43f4077630bd896da88715dec894392c63ac666b /doc/src/declarative
parent35a211cd95e0d09ef0b547b57f01f0a9ff41da2f (diff)
downloadQt-17d0ed5af4922645a268b6550742fb521d459c8e.zip
Qt-17d0ed5af4922645a268b6550742fb521d459c8e.tar.gz
Qt-17d0ed5af4922645a268b6550742fb521d459c8e.tar.bz2
Disallow ids that start with uppercase letters and update docs and
examples accordingly. Task-number: QT-2786
Diffstat (limited to 'doc/src/declarative')
-rw-r--r--doc/src/declarative/anchor-layout.qdoc8
-rw-r--r--doc/src/declarative/qmlintro.qdoc23
2 files changed, 19 insertions, 12 deletions
diff --git a/doc/src/declarative/anchor-layout.qdoc b/doc/src/declarative/anchor-layout.qdoc
index 4766236..2bd0ec5 100644
--- a/doc/src/declarative/anchor-layout.qdoc
+++ b/doc/src/declarative/anchor-layout.qdoc
@@ -87,8 +87,8 @@ By specifying multiple horizontal or vertical anchors you can control the size o
\code
Rectangle { id: rect1; x: 0; ... }
-Rectangle { id: rect2; anchors.left: rect1.right; anchors.right: Rect3.left; ... }
-Rectangle { id: Rect3; x: 150; ... }
+Rectangle { id: rect2; anchors.left: rect1.right; anchors.right: rect3.left; ... }
+Rectangle { id: rect3; x: 150; ... }
\endcode
\image edge4.png
@@ -99,11 +99,11 @@ For performance reasons, you can only anchor an item to its siblings and direct
\badcode
Item {
- id: Group1
+ id: group1
Rectangle { id: rect1; ... }
}
Item {
- id: Group2
+ id: group2
Rectangle { id: rect2; anchors.left: rect1.right; ... } // invalid anchor!
}
\endcode
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