diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-09-15 13:21:33 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-09-15 13:21:33 (GMT) |
commit | b13365187b58ecc2d259589ab523a7d0da84dc83 (patch) | |
tree | b9faa53420fba2e0f4249449b5c997cf26477cdf /examples/declarative | |
parent | edf7c7c045559b1d03f1d64d2334adac7da88527 (diff) | |
download | Qt-b13365187b58ecc2d259589ab523a7d0da84dc83.zip Qt-b13365187b58ecc2d259589ab523a7d0da84dc83.tar.gz Qt-b13365187b58ecc2d259589ab523a7d0da84dc83.tar.bz2 |
Focus changes to QFxItem and QFxView.
Remove QFxItem::activeFocus, make QFxItem::focus behave like
QGraphicsItem::focus (same as activeFocus essentially). Introduce
QFxItem::wantsFocus to provide the same behavior as QFxItem::focus used
to.
Also updated the focusScope manual tests to reflect this new behavior.
This change is going to break every example that relies on activeFocus.
The fix is to replace all references with "focus" instead. All places
that bind to "focus" should now bind to "wantsFocus" instead.
Reviewed-by: akennedy
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/focusscope/test.qml | 14 | ||||
-rw-r--r-- | examples/declarative/focusscope/test2.qml | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/examples/declarative/focusscope/test.qml b/examples/declarative/focusscope/test.qml index 22ffc8d..77ffb84 100644 --- a/examples/declarative/focusscope/test.qml +++ b/examples/declarative/focusscope/test.qml @@ -19,21 +19,21 @@ Rectangle { color: "transparent" border.width: 5 - border.color: MyScope.focus?"blue":"black" + border.color: MyScope.wantsFocus?"blue":"black" Rectangle { id: Item1 x: 10; y: 10 width: 100; height: 100; color: "green" border.width: 5 - border.color: focus?"blue":"black" + border.color: wantsFocus?"blue":"black" Keys.onDigit9Pressed: print("Top Left"); KeyNavigation.right: Item2 focus: true Rectangle { width: 50; height: 50; anchors.centerIn: parent - color: parent.activeFocus?"red":"transparent" + color: parent.focus?"red":"transparent" } } @@ -42,13 +42,13 @@ Rectangle { x: 310; y: 10 width: 100; height: 100; color: "green" border.width: 5 - border.color: focus?"blue":"black" + border.color: wantsFocus?"blue":"black" KeyNavigation.left: Item1 Keys.onDigit9Pressed: print("Top Right"); Rectangle { width: 50; height: 50; anchors.centerIn: parent - color: parent.activeFocus?"red":"transparent" + color: parent.focus?"red":"transparent" } } } @@ -62,14 +62,14 @@ Rectangle { x: 10; y: 300 width: 100; height: 100; color: "green" border.width: 5 - border.color: focus?"blue":"black" + border.color: wantsFocus?"blue":"black" Keys.onDigit9Pressed: print("Bottom Left"); KeyNavigation.up: MyScope Rectangle { width: 50; height: 50; anchors.centerIn: parent - color: parent.activeFocus?"red":"transparent" + color: parent.focus?"red":"transparent" } } diff --git a/examples/declarative/focusscope/test2.qml b/examples/declarative/focusscope/test2.qml index 0ac0f5d..5b6971a 100644 --- a/examples/declarative/focusscope/test2.qml +++ b/examples/declarative/focusscope/test2.qml @@ -10,27 +10,27 @@ Rectangle { FocusScope { y: 100 focus: true - Rectangle { width: 50; height: 50; color: parent.focus?"red":"blue" } + Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" } FocusScope { y: 100 focus: true - Rectangle { width: 50; height: 50; color: parent.focus?"red":"blue" } + Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" } FocusScope { y: 100 focus: true - Rectangle { width: 50; height: 50; color: parent.focus?"red":"blue" } + Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" } FocusScope { y: 100 focus: true - Rectangle { width: 50; height: 50; color: parent.focus?"red":"blue" } + Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" } FocusScope { y: 100 focus: true - Rectangle { width: 50; height: 50; color: parent.focus?"red":"blue" } + Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" } } } } |