diff options
author | Valery Volgutov <valery.volgutov@lge.com> | 2020-04-20 20:42:56 +0300 |
---|---|---|
committer | Dominik Holland <dominik.holland@qt.io> | 2020-06-12 12:23:21 +0200 |
commit | f07641b47a7c479894472e933d202bfcec0e222e (patch) | |
tree | fc3759295c675cb699b076a8d459f8157fd91c16 /src/quick | |
parent | 185d9b5b72a2c062c4670b17385ec1e6e576c4d9 (diff) |
Fix QQuickKeyNavigationAttached issue
When Repeater used for Item creation, we have following issue:
When Repeater creates a new item and this item tries to
set keyboard.left or keyboard.right to another Repeater-created
sibling, these items haven't been created yet, and we have issue with
navigation keys.
Set rightSet to true if right really changed.
When object calls KeyboardNavigation::setRight(null),
rightSet = true, but right field did not change (null).
After that, navigation keys work incorrectly.
The same for other cases.
Task-number: QTBUG-83356
Pick-to: 5.15
Change-Id: I9ea6d6a7d13ff989aac3d9e2d22467b48080de13
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 3280ae861f..b3cb71a928 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -465,8 +465,8 @@ void QQuickKeyNavigationAttached::setLeft(QQuickItem *i) Q_D(QQuickKeyNavigationAttached); if (d->leftSet && d->left == i) return; + d->leftSet = d->left != i; d->left = i; - d->leftSet = true; QQuickKeyNavigationAttached* other = qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(i)); if (other && !other->d_func()->rightSet){ @@ -487,8 +487,8 @@ void QQuickKeyNavigationAttached::setRight(QQuickItem *i) Q_D(QQuickKeyNavigationAttached); if (d->rightSet && d->right == i) return; + d->rightSet = d->right != i; d->right = i; - d->rightSet = true; QQuickKeyNavigationAttached* other = qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(i)); if (other && !other->d_func()->leftSet){ @@ -509,8 +509,8 @@ void QQuickKeyNavigationAttached::setUp(QQuickItem *i) Q_D(QQuickKeyNavigationAttached); if (d->upSet && d->up == i) return; + d->upSet = d->up != i; d->up = i; - d->upSet = true; QQuickKeyNavigationAttached* other = qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(i)); if (other && !other->d_func()->downSet){ @@ -531,8 +531,8 @@ void QQuickKeyNavigationAttached::setDown(QQuickItem *i) Q_D(QQuickKeyNavigationAttached); if (d->downSet && d->down == i) return; + d->downSet = d->down != i; d->down = i; - d->downSet = true; QQuickKeyNavigationAttached* other = qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(i)); if (other && !other->d_func()->upSet) { @@ -553,8 +553,8 @@ void QQuickKeyNavigationAttached::setTab(QQuickItem *i) Q_D(QQuickKeyNavigationAttached); if (d->tabSet && d->tab == i) return; + d->tabSet = d->tab != i; d->tab = i; - d->tabSet = true; QQuickKeyNavigationAttached* other = qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(i)); if (other && !other->d_func()->backtabSet) { @@ -575,8 +575,8 @@ void QQuickKeyNavigationAttached::setBacktab(QQuickItem *i) Q_D(QQuickKeyNavigationAttached); if (d->backtabSet && d->backtab == i) return; + d->backtabSet = d->backtab != i; d->backtab = i; - d->backtabSet = true; QQuickKeyNavigationAttached* other = qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(i)); if (other && !other->d_func()->tabSet) { |