summaryrefslogtreecommitdiff
path: root/src/declarative
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-01-26 15:23:52 +0100
committerDavid Boddie <david.boddie@nokia.com>2011-01-26 15:23:52 +0100
commit20a3e23bb07a8c4b363ebeb9124d04db9fe3226e (patch)
tree5dcf25005d4f434d1dd95d712c135eaa56d860d3 /src/declarative
parent67fbf125f3f96ea0ff0da66b1dd8b7dd348ca69f (diff)
downloadqt4-tools-20a3e23bb07a8c4b363ebeb9124d04db9fe3226e.tar.gz
Doc: Fixed the syntax of QML code snippets.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp13
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp14
2 files changed, 16 insertions, 11 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 5dbde15488..2f53f21a36 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -890,14 +890,7 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation()
then jump to \c Item.BottomRight. To fix this, insert a PropertyAction
before the RotationAnimation begins:
- \qml
- transitions: Transition {
- SequentialAnimation {
- PropertyAction { target: rect; property: "transformOrigin" }
- RotationAnimation { ... }
- }
- }
- \endqml
+ \snippet doc/src/snippets/declarative/propertyaction-sequential.qml sequential
This immediately sets the \c transformOrigin property to the value defined
in the end state of the \l Transition (i.e. the value defined in the
@@ -1186,7 +1179,9 @@ void QDeclarativeNumberAnimation::init()
\qml
Item {
- states: [ ... ]
+ states: [
+ // ...
+ ]
transition: Transition {
NumberAnimation { properties: "x"; from: 100; duration: 200 }
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index d39da3f77e..eba9cf96ac 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -262,8 +262,18 @@ void QDeclarativeFontLoader::updateFontInfo(const QString& name, QDeclarativeFon
Example:
\qml
- FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
- Text { text: "Fancy font"; font.family: webFont.name }
+ Item {
+ width: 200; height: 50
+
+ FontLoader {
+ id: webFont
+ source: "http://www.mysite.com/myfont.ttf"
+ }
+ Text {
+ text: "Fancy font"
+ font.family: webFont.name
+ }
+ }
\endqml
*/
QString QDeclarativeFontLoader::name() const