diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-03-09 01:00:06 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-03-09 10:54:36 +0100 |
commit | f65c0e7190c4f2ebcadc963cf0647c71de26f3bb (patch) | |
tree | 9e6525274d9aa01d4fff9e059dc5b428cbf2f447 /src/quick/items/qquickitem.cpp | |
parent | 433f5be47b8245e955bad5a4d3cfcc38354ce62a (diff) | |
parent | d51d5ff3c187821929cf7b765e037423bcc90466 (diff) |
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index fe8df6fb64..4d9e3de859 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2569,6 +2569,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, @@ -2644,7 +2645,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"; @@ -8254,6 +8260,10 @@ bool QQuickItem::event(QEvent *ev) ev->ignore(); break; #endif // gestures + case QEvent::LanguageChange: + for (QQuickItem *item : d->childItems) + QCoreApplication::sendEvent(item, ev); + break; default: return QObject::event(ev); } |