diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-05-17 04:44:25 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-05-17 04:45:59 (GMT) |
commit | a0c9a0feebb571e339c0ea886996f543d2d8c752 (patch) | |
tree | 2af8b37d98be5cae7000866e8e8f55566edbd712 /doc/src/snippets | |
parent | e86732a38bc601c51a41400c1000b857b71f2e75 (diff) | |
download | Qt-a0c9a0feebb571e339c0ea886996f543d2d8c752.zip Qt-a0c9a0feebb571e339c0ea886996f543d2d8c752.tar.gz Qt-a0c9a0feebb571e339c0ea886996f543d2d8c752.tar.bz2 |
Add focus docs snippets
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/declarative/focusscopes.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/focusscopes.qml b/doc/src/snippets/declarative/focusscopes.qml new file mode 100644 index 0000000..686de29 --- /dev/null +++ b/doc/src/snippets/declarative/focusscopes.qml @@ -0,0 +1,27 @@ +import Qt 4.7 + +//![0] +Rectangle { + color: "lightsteelblue"; width: 240; height: 320 + + ListView { + anchors.fill: parent + focus: true + + model: ListModel { + ListElement { name: "Bob" } + ListElement { name: "John" } + ListElement { name: "Michael" } + } + + delegate: FocusScope { + width: childrenRect.width; height: childrenRect.height + TextInput { + focus: true + text: name + Keys.onReturnPressed: console.log(name) + } + } + } + } +//![0] |