diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-07-21 02:23:15 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-07-21 02:33:18 (GMT) |
commit | 21806ff0921641b4e4d9d39721ab4ebeae74dddc (patch) | |
tree | 6f854d6279385c120986f0288eb997373058106a /examples | |
parent | 4f6e480acce94d8ae920c3eda4879fc4f9cb2598 (diff) | |
download | Qt-21806ff0921641b4e4d9d39721ab4ebeae74dddc.zip Qt-21806ff0921641b4e4d9d39721ab4ebeae74dddc.tar.gz Qt-21806ff0921641b4e4d9d39721ab4ebeae74dddc.tar.bz2 |
QML focus API updates.
The wantsFocus property has been renamed to activeFocus, to better
reflect its value. Reading and writing the focus property is also now
consistent -- this property represents focus within a scope. Other small
changes were made to keep things consistent with the new naming.
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'examples')
5 files changed, 11 insertions, 12 deletions
diff --git a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml index 9a8d3f3..19f7235 100644 --- a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml +++ b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml @@ -43,7 +43,7 @@ import Qt 4.7 FocusScope { property alias interactive: gridView.interactive - onWantsFocusChanged: if (wantsFocus) mainView.state = "" + onActiveFocusChanged: if (activeFocus) mainView.state = "" Rectangle { anchors.fill: parent @@ -84,12 +84,12 @@ FocusScope { onClicked: { GridView.view.currentIndex = index - container.forceFocus() + container.forceActiveFocus() } } states: State { - name: "active"; when: container.focus == true + name: "active"; when: container.activeFocus PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 } } diff --git a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml index cc13637..602b52b 100644 --- a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml +++ b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml @@ -69,12 +69,12 @@ Item { onClicked: { ListView.view.currentIndex = index - container.forceFocus() + container.forceActiveFocus() } } states: State { - name: "active"; when: container.focus == true + name: "active"; when: container.activeFocus PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 } PropertyChanges { target: label; font.pixelSize: 16 } } diff --git a/examples/declarative/keyinteraction/focus/Core/ListViews.qml b/examples/declarative/keyinteraction/focus/Core/ListViews.qml index 6f9ceb4..3d6ceab 100644 --- a/examples/declarative/keyinteraction/focus/Core/ListViews.qml +++ b/examples/declarative/keyinteraction/focus/Core/ListViews.qml @@ -43,11 +43,11 @@ import Qt 4.7 FocusScope { clip: true - onWantsFocusChanged: if (wantsFocus) mainView.state = "showListViews" + onActiveFocusChanged: if (activeFocus) mainView.state = "showListViews" ListView { id: list1 - y: wantsFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20 + y: activeFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20 focus: true KeyNavigation.up: gridMenu; KeyNavigation.left: contextMenu; KeyNavigation.right: list2 model: 10; cacheBuffer: 200 @@ -60,7 +60,7 @@ FocusScope { ListView { id: list2 - y: wantsFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20 + y: activeFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20 KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3 model: 10; cacheBuffer: 200 delegate: ListViewDelegate {} @@ -72,7 +72,7 @@ FocusScope { ListView { id: list3 - y: wantsFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20 + y: activeFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20 KeyNavigation.up: gridMenu; KeyNavigation.left: list2 model: 10; cacheBuffer: 200 delegate: ListViewDelegate {} diff --git a/examples/declarative/keyinteraction/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml index 8b2af70..56fdffc 100644 --- a/examples/declarative/keyinteraction/focus/focus.qml +++ b/examples/declarative/keyinteraction/focus/focus.qml @@ -58,7 +58,7 @@ Rectangle { width: parent.width; height: 320 focus: true - interactive: parent.wantsFocus + interactive: parent.activeFocus } ListViews { @@ -98,7 +98,7 @@ Rectangle { states: State { name: "contextMenuOpen" - when: !mainView.wantsFocus + when: !mainView.activeFocus PropertyChanges { target: contextMenu; x: 0; open: true } PropertyChanges { target: mainView; x: 130 } PropertyChanges { target: shade; opacity: 0.25 } diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qml b/examples/declarative/toys/dynamicscene/dynamicscene.qml index 1edb841..2a22a5f 100644 --- a/examples/declarative/toys/dynamicscene/dynamicscene.qml +++ b/examples/declarative/toys/dynamicscene/dynamicscene.qml @@ -184,7 +184,6 @@ Item { id: qmlText anchors.fill: parent; anchors.margins: 5 readOnly: false - focusOnPress: true font.pixelSize: 14 wrapMode: TextEdit.WordWrap |