diff options
author | David Boddie <david.boddie@nokia.com> | 2011-01-19 14:49:41 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-01-19 14:49:41 (GMT) |
commit | 59a35a794e433f9526aff72025c0899e76ef362e (patch) | |
tree | 95884ba6507730688201d36955614ed68fcdbaea /src/declarative | |
parent | 05a678de3f2e4fe67dc1f93a2dee18e197c0e1c0 (diff) | |
download | Qt-59a35a794e433f9526aff72025c0899e76ef362e.zip Qt-59a35a794e433f9526aff72025c0899e76ef362e.tar.gz Qt-59a35a794e433f9526aff72025c0899e76ef362e.tar.bz2 |
Doc: Fixed QML syntax.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitem.cpp | 32 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepath.cpp | 6 |
2 files changed, 23 insertions, 15 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 2e3a5a2..7ddf949 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -799,10 +799,18 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post) This example forwards key events to two lists: \qml - ListView { id: list1 ... } - ListView { id: list2 ... } - Keys.forwardTo: [list1, list2] - focus: true + Item { + ListView { + id: list1 + // ... + } + ListView { + id: list2 + // ... + } + Keys.forwardTo: [list1, list2] + focus: true + } \endqml */ @@ -2542,14 +2550,14 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi This property is often used in scripts to change between states. For example: - \qml - function toggle() { - if (button.state == 'On') - button.state = 'Off'; - else - button.state = 'On'; - } - \endqml + \js + function toggle() { + if (button.state == 'On') + button.state = 'Off'; + else + button.state = 'On'; + } + \endjs If the item is in its base state (i.e. no explicit state has been set), \c state will be a blank string. Likewise, you can return an diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp index bc395d2..48e3f66 100644 --- a/src/declarative/graphicsitems/qdeclarativepath.cpp +++ b/src/declarative/graphicsitems/qdeclarativepath.cpp @@ -845,7 +845,7 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path) \o \qml PathView { - ... + // ... Path { startX: 20; startY: 0 PathQuad { x: 50; y: 80; controlX: 0; controlY: 80 } @@ -859,7 +859,7 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path) \o \qml PathView { - ... + // ... Path { startX: 20; startY: 0 PathQuad { x: 50; y: 80; controlX: 0; controlY: 80 } @@ -892,7 +892,7 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path) \qml PathView { - ... + // ... Path { startX: 0; startY: 0 PathLine { x:100; y: 0; } |