diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-09 00:32:00 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-09 00:32:00 (GMT) |
commit | ccb3f7c3bda46ace7b42bff5a27a11bd07602b68 (patch) | |
tree | 8b4b33f05fa16814766550f1d064567531b8796a /doc/src/declarative/focus.qdoc | |
parent | 05e4f1eaeb3f916bcf845ae0d7e85d283e9ca1bd (diff) | |
parent | db531c30eb73ff7aeac9cf07b06d6a108b2c13ec (diff) | |
download | Qt-ccb3f7c3bda46ace7b42bff5a27a11bd07602b68.zip Qt-ccb3f7c3bda46ace7b42bff5a27a11bd07602b68.tar.gz Qt-ccb3f7c3bda46ace7b42bff5a27a11bd07602b68.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'doc/src/declarative/focus.qdoc')
-rw-r--r-- | doc/src/declarative/focus.qdoc | 81 |
1 files changed, 61 insertions, 20 deletions
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index dd5dcaf..8733b2d 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \target qmlfocus \page qmlfocus.html @@ -17,7 +58,7 @@ When the user presses or releases a key, the following occurs: \o The key event is delivered by the scene to the QML \l Item with \e {active focus}. If no \l Item has \e {active focus}, the key event is \l {QEvent::ignore()}{ignored} and regular Qt key handling continues. \o If the QML \l Item with \e {active focus} accepts the key event, propagation stops. Otherwise the event is "bubbled up", by recursively passing it to each \l Item's parent until either the event is accepted, or the root \l Item is reached. -If the \c {Rect} element in the following example has active focus and the \e A key is pressed, it will bubble up to the \c {KeyActions}. However, pressing the \e B key will bubble up to the root item and thus subsequently be \l {QEvent::ignore()}{ignored}. +If the \c {Rectangle} element in the following example has active focus and the \e A key is pressed, it will bubble up to the \c {KeyActions}. However, pressing the \e B key will bubble up to the root item and thus subsequently be \l {QEvent::ignore()}{ignored}. \code Item { @@ -58,12 +99,12 @@ the \c {KeyActions} element has \e {active focus} and pressing the \o \code Rectangle { color: "lightsteelblue"; width: 240; height: 25 - Text { id: MyText } + Text { id: myText } KeyActions { focus: true - keyA: "MyText.text = 'Key A was pressed'" - keyB: "MyText.text = 'Key B was pressed'" - keyC: "MyText.text = 'Key C was pressed'" + keyA: "myText.text = 'Key A was pressed'" + keyB: "myText.text = 'Key B was pressed'" + keyC: "myText.text = 'Key C was pressed'" } } \endcode @@ -92,23 +133,23 @@ Rectangle { color: "red"; width: 240; height: 55 Rectangle { color: "lightsteelblue"; width: 240; height: 25 - Text { id: MyText } + Text { id: myText } KeyActions { focus: true - keyA: "MyText.text = 'Key A was pressed'" - keyB: "MyText.text = 'Key B was pressed'" - keyC: "MyText.text = 'Key C was pressed'" + keyA: "myText.text = 'Key A was pressed'" + keyB: "myText.text = 'Key B was pressed'" + keyC: "myText.text = 'Key C was pressed'" } } Rectangle { y: 30; focus: true color: "lightsteelblue"; width: 240; height: 25 - Text { id: MyText } + Text { id: myText } KeyActions { focus: true - keyA: "MyText.text = 'Key A was pressed'" - keyB: "MyText.text = 'Key B was pressed'" - keyC: "MyText.text = 'Key C was pressed'" + keyA: "myText.text = 'Key A was pressed'" + keyB: "myText.text = 'Key B was pressed'" + keyC: "myText.text = 'Key C was pressed'" } } } @@ -149,12 +190,12 @@ FocusScope { width: 240; height: 25 Rectangle { color: "lightsteelblue"; width: 240; height: 25 - Text { id: MyText } + Text { id: myText } KeyActions { focus: true - keyA: "MyText.text = 'Key A was pressed'" - keyB: "MyText.text = 'Key B was pressed'" - keyC: "MyText.text = 'Key C was pressed'" + keyA: "myText.text = 'Key A was pressed'" + keyB: "myText.text = 'Key B was pressed'" + keyC: "myText.text = 'Key C was pressed'" } } } @@ -186,9 +227,9 @@ Rectangle { \endcode \o \code FocusScope { - id: Page; width: 240; height: 25 + id: page; width: 240; height: 25 MyWidget { focus: true } - MouseRegion { anchors.fill: parent; onClicked: { Page.focus = true } } + MouseRegion { anchors.fill: parent; onClicked: { page.focus = true } } } \endcode \endtable @@ -221,7 +262,7 @@ Rectangle { color: "lightsteelblue"; width: 240; height: 320 ListView { - id: MyView; anchors.fill: parent; focus: true + id: myView; anchors.fill: parent; focus: true model: ListModel { ListElement { name: "Bob" } ListElement { name: "John" } |