diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2020-03-10 09:43:44 +0200 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2020-03-10 09:43:44 +0200 |
commit | b67264a2644b22dc23f6a06ff48974c77cb45d84 (patch) | |
tree | 3ac6547ac4daecac92feb4d192ed0cf97f5b758a /src/quick/items/qquickitem.cpp | |
parent | df034c07be4828778d43a4037f89f31ac26f411d (diff) | |
parent | 92daa739ec114a0c9ae841db0459b0eff1f86cef (diff) |
Merge 5.14 into 5.14.2
Change-Id: I294cb27a59754f7090f9bc1a500faf0423571549
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 3785abc450..11c1f12e75 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2568,6 +2568,7 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo bool skip = false; QQuickItem *startItem = item; + QQuickItem *originalStartItem = startItem; // Protect from endless loop: // If we start on an invisible item we will not find it again. // If there is no other item which can become the focus item, we have a forever loop, @@ -2643,7 +2644,12 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo } } from = last; - if (current == startItem && from == firstFromItem) { + // if [from] item is equal to [firstFromItem], means we have traversed one path and + // jump back to parent of the chain, and then we have to check whether we have + // traversed all of the chain (by compare the [current] item with [startItem]) + // Since the [startItem] might be promoted to its parent if it is invisible, + // we still have to check [current] item with original start item + if ((current == startItem || current == originalStartItem) && from == firstFromItem) { // wrapped around, avoid endless loops if (item == contentItem) { qCDebug(DBG_FOCUS) << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return contentItem"; |