summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/qdeclarativeintro.qdoc
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-01-25 12:43:32 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2011-01-25 12:43:32 (GMT)
commit422514d98ac9a6c4df36caad81e6f315f3b80086 (patch)
treed69f70fb231b57ff5114195604255c9efc3f4890 /doc/src/declarative/qdeclarativeintro.qdoc
parentc53832da5da7ad6cec6e809c30a06c8771bb9885 (diff)
downloadQt-422514d98ac9a6c4df36caad81e6f315f3b80086.zip
Qt-422514d98ac9a6c4df36caad81e6f315f3b80086.tar.gz
Qt-422514d98ac9a6c4df36caad81e6f315f3b80086.tar.bz2
Doc: Fixed broken QML code snippets.
Diffstat (limited to 'doc/src/declarative/qdeclarativeintro.qdoc')
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc17
1 files changed, 9 insertions, 8 deletions
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index 4b7dce5..9b96d43 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -160,19 +160,19 @@ characters other than letters, numbers and underscores.
JavaScript expressions can be used to assign property values. For example:
-\code
+\qml
Item {
width: 100 * 3
height: 50 + 22
}
-\endcode
+\endqml
These expressions can include references to other objects and properties, in which case
a \l{Property Binding}{binding} is established: when the value of the expression changes,
the property to which the expression is assigned is automatically updated to the
new value. For example:
-\code
+\qml
Item {
width: 300
height: 300
@@ -183,7 +183,7 @@ Item {
color: "yellow"
}
}
-\endcode
+\endqml
Here, the \l Rectangle object's \c width property is set relative to the width
of its parent. Whenever the parent's width changes, the width of the \l Rectangle is
@@ -330,7 +330,7 @@ element that attaches \e property.
For example, the \l ListView element attaches the \e ListView.isCurrentItem property
to each delegate it creates:
-\code
+\qml
Component {
id: myDelegate
Text {
@@ -338,10 +338,13 @@ Component {
color: ListView.isCurrentItem ? "red" : "blue"
}
}
+\endqml
+
+\qml
ListView {
delegate: myDelegate
}
-\endcode
+\endqml
Another example of attached properties is the \l Keys element which
attaches properties for handling key presses to
@@ -390,6 +393,4 @@ MouseArea {
}
}
\endqml
-
-
*/