diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-29 10:48:54 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-29 10:48:54 +0100 |
commit | 4e33b069c426c975319d91e11223114fd0d8ad40 (patch) | |
tree | d73e1251bc313b7303fdb000c0789cdfb4c7bb1f /src/quick/items/qquickitem.cpp | |
parent | d9e70d1a49af347f79db7e64bdd8e2e8083a77b5 (diff) | |
parent | 05d8ffb4dff5e693967c8ee7cee6d6158eadccbd (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/quick/items/qquickaccessibleattached_p.h
src/quick/items/qquickwindow.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp
Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index b68a9b5455..b2ee5af6ff 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -452,7 +452,7 @@ QQuickItem *QQuickKeyNavigationAttached::left() const void QQuickKeyNavigationAttached::setLeft(QQuickItem *i) { Q_D(QQuickKeyNavigationAttached); - if (d->left == i) + if (d->leftSet && d->left == i) return; d->left = i; d->leftSet = true; @@ -474,7 +474,7 @@ QQuickItem *QQuickKeyNavigationAttached::right() const void QQuickKeyNavigationAttached::setRight(QQuickItem *i) { Q_D(QQuickKeyNavigationAttached); - if (d->right == i) + if (d->rightSet && d->right == i) return; d->right = i; d->rightSet = true; @@ -496,7 +496,7 @@ QQuickItem *QQuickKeyNavigationAttached::up() const void QQuickKeyNavigationAttached::setUp(QQuickItem *i) { Q_D(QQuickKeyNavigationAttached); - if (d->up == i) + if (d->upSet && d->up == i) return; d->up = i; d->upSet = true; @@ -518,7 +518,7 @@ QQuickItem *QQuickKeyNavigationAttached::down() const void QQuickKeyNavigationAttached::setDown(QQuickItem *i) { Q_D(QQuickKeyNavigationAttached); - if (d->down == i) + if (d->downSet && d->down == i) return; d->down = i; d->downSet = true; @@ -540,7 +540,7 @@ QQuickItem *QQuickKeyNavigationAttached::tab() const void QQuickKeyNavigationAttached::setTab(QQuickItem *i) { Q_D(QQuickKeyNavigationAttached); - if (d->tab == i) + if (d->tabSet && d->tab == i) return; d->tab = i; d->tabSet = true; @@ -562,7 +562,7 @@ QQuickItem *QQuickKeyNavigationAttached::backtab() const void QQuickKeyNavigationAttached::setBacktab(QQuickItem *i) { Q_D(QQuickKeyNavigationAttached); - if (d->backtab == i) + if (d->backtabSet && d->backtab == i) return; d->backtab = i; d->backtabSet = true; @@ -1607,17 +1607,9 @@ void QQuickItemPrivate::setLayoutMirror(bool mirror) } } -void QQuickItemPrivate::setAccessibleFlagAndListener() +void QQuickItemPrivate::setAccessible() { - Q_Q(QQuickItem); - QQuickItem *item = q; - while (item) { - if (item->d_func()->isAccessible) - break; // already set - grandparents should have the flag set as well. - - item->d_func()->isAccessible = true; - item = item->d_func()->parentItem; - } + isAccessible = true; } /*! @@ -1757,6 +1749,19 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus) surface. Using scene graph API directly is always significantly faster. + \section1 Behavior Animations + + If your Item uses the \l Behavior type to define animations for property + changes, you should always use either QObject::setProperty(), + QQmlProperty(), or QMetaProperty::write() when you need to modify those + properties from C++. This ensures that the QML engine knows about the + property change. Otherwise, the engine won't be able to carry out your + requested animation. For example, if you call \l setPosition() directly, + any behavior that reacts to changes in the x or y properties will not take + effect, as you are bypassing Qt's meta-object system. Note that these + functions incur a slight performance penalty. For more details, see + \l {Accessing Members of a QML Object Type from C++}. + \sa QQuickWindow, QQuickPaintedItem */ @@ -2584,9 +2589,6 @@ void QQuickItem::setParentItem(QQuickItem *parentItem) d->itemChange(ItemParentHasChanged, d->parentItem); d->parentNotifier.notify(); - if (d->isAccessible && d->parentItem) { - d->parentItem->d_func()->setAccessibleFlagAndListener(); - } emit parentChanged(d->parentItem); if (isVisible() && d->parentItem) |