Fix forceActiveFocus() with multiple items having focus: true
authorAndrew den Exter <andrew.den-exter@nokia.com>
Wed, 28 Mar 2012 08:11:14 +0000 (18:11 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 30 Mar 2012 05:53:56 +0000 (07:53 +0200)
commitd2447feece42859011d7995dff5614f3d1758e64
tree3fa93f7829051210927d2d09f6b05e47aac025fe
parent2ab873ed5fbb43404f119ef05b412485665a975f
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>
src/quick/items/qquickitem.cpp
tests/auto/quick/qquickitem/data/focusSubItemInNonFocusScope.qml [new file with mode: 0644]
tests/auto/quick/qquickitem/tst_qquickitem.cpp