Skip to content

Commit

Permalink
Treat parentless items as focus scopes
Browse files Browse the repository at this point in the history
The root item of a tree is implicitly a focus scope simply because it is
the root of the tree. QQuickRootItem could gain the focus scope flag in
order to solve this for most cases, but there would still be a
possiblity of a crash for disconnected trees.

Change-Id: I6e04f11df4268fb3b96660d50707d70935a5dc5e
Reviewed-by: Martin Jones <martin.jones@nokia.com>
  • Loading branch information
Alan Alpert authored and Qt by Nokia committed Mar 2, 2012
1 parent 4dde313 commit 3c42ca8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/quick/items/qquickitem.cpp
Expand Up @@ -2121,7 +2121,7 @@ QQuickItem *QQuickItemPrivate::InitializationState::getFocusScope(QQuickItem *it
{
if (!focusScope) {
QQuickItem *fs = item->parentItem();
while (!fs->isFocusScope())
while (fs->parentItem() && !fs->isFocusScope())
fs = fs->parentItem();
focusScope = fs;
}
Expand Down

0 comments on commit 3c42ca8

Please sign in to comment.