From 057972edc90da80252764e1b3abb71e1e6ab0191 Mon Sep 17 00:00:00 2001 From: Valery Volgutov Date: Mon, 20 Apr 2020 20:42:56 +0300 Subject: Fix QQuickKeyNavigationAttached issue When Repeater used for Item creation, we have following issue: When Repeater create new item and this item tried to use keyboard.left or keyboard.right to other Repeater's item - these items don't create yet, and we have issue with navigation keys. Set rightSet to true if right really changed. When object call KeboardNavigation::setRight with null item. rightSet field = true, but right field did not changed (null). After that navigation keys works incorrect. The same for other cases. Task-number: QTBUG-83356 Change-Id: I9ea6d6a7d13ff989aac3d9e2d22467b48080de13 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/quick/items/qquickitem.cpp') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 2645ce97a6..a403b393a3 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -464,8 +464,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(qmlAttachedPropertiesObject(i)); if (other && !other->d_func()->rightSet){ @@ -486,8 +486,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(qmlAttachedPropertiesObject(i)); if (other && !other->d_func()->leftSet){ @@ -508,8 +508,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(qmlAttachedPropertiesObject(i)); if (other && !other->d_func()->downSet){ @@ -530,8 +530,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(qmlAttachedPropertiesObject(i)); if (other && !other->d_func()->upSet) { @@ -552,8 +552,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(qmlAttachedPropertiesObject(i)); if (other && !other->d_func()->backtabSet) { @@ -574,8 +574,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(qmlAttachedPropertiesObject(i)); if (other && !other->d_func()->tabSet) { -- cgit v1.2.3