diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-03-28 18:11:14 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-30 07:53:56 +0200 |
commit | d2447feece42859011d7995dff5614f3d1758e64 (patch) | |
tree | 3fa93f7829051210927d2d09f6b05e47aac025fe /tests/auto/quick/qquickitem/data | |
parent | 2ab873ed5fbb43404f119ef05b412485665a975f (diff) |
Fix forceActiveFocus() with multiple items having focus: true
Ensure focus is cleared from an item if it is parented to an item that
already has a sub focus item. Checking scopedFocusItem() didn't allow
for the case where an unparented item is the root of the focus tree
but not itself a focus scope, checking the unguarded subFocusItem
member will.
Change-Id: I482779e8077e9f282d22bd0090e669840764e52a
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickitem/data')
-rw-r--r-- | tests/auto/quick/qquickitem/data/focusSubItemInNonFocusScope.qml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickitem/data/focusSubItemInNonFocusScope.qml b/tests/auto/quick/qquickitem/data/focusSubItemInNonFocusScope.qml new file mode 100644 index 0000000000..0e50710717 --- /dev/null +++ b/tests/auto/quick/qquickitem/data/focusSubItemInNonFocusScope.qml @@ -0,0 +1,23 @@ +import QtQuick 2.0 + +Rectangle { + width: 400; height: 400 + + FocusScope { + width: 400; height: 400 + focus: true + Item { + width: 400; height: 400 + Item { + id: dummy + objectName: "dummyItem" + focus: true + } + TextInput { + id: ti + objectName: "textInput" + focus: true + } + } + } +} |