diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-07-21 12:23:15 +1000 |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-07-21 12:33:18 +1000 |
commit | 21806ff0921641b4e4d9d39721ab4ebeae74dddc (patch) | |
tree | 6f854d6279385c120986f0288eb997373058106a /examples/declarative/keyinteraction/focus/Core | |
parent | 4f6e480acce94d8ae920c3eda4879fc4f9cb2598 (diff) | |
download | qt4-tools-21806ff0921641b4e4d9d39721ab4ebeae74dddc.tar.gz |
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/declarative/keyinteraction/focus/Core')
3 files changed, 9 insertions, 9 deletions
diff --git a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml index 9a8d3f3726..19f723582f 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 cc13637d83..602b52b970 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 6f9ceb49d4..3d6ceabd9f 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 {} |