Commit 3c42ca87 authored by Alan Alpert's avatar Alan Alpert Committed by Qt by Nokia

Treat parentless items as focus scopes

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: default avatarMartin Jones <martin.jones@nokia.com>
parent 4dde3131
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment