diff options
Diffstat (limited to 'doc')
4 files changed, 21 insertions, 14 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 diff --git a/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml b/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml index 31e02ea..6832308 100644 --- a/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml +++ b/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml @@ -1,7 +1,7 @@ import Qt 4.6 ListModel { - id: ContactModel + id: contactModel ListElement { name: "Bill Smith" number: "555 3264" diff --git a/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml b/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml index 20b3b7d..1334cf4 100644 --- a/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml +++ b/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml @@ -1,7 +1,7 @@ import Qt 4.6 ListModel { - id: MenuModel + id: menuModel ListElement { name: "Bill Jones" icon: "pics/qtlogo-64.png" |