diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-03 17:07:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-04 18:28:55 +0100 |
commit | 63b8285a2d528be82015133bd72a91c17c3a460b (patch) | |
tree | 28f6c8ecd23ad2cc58c8d99dc18e03b55657d041 | |
parent | 799fff7e59e8c379c069523b305ea29b73f7299d (diff) |
[new compiler] Fix bindings on aliases
When installing bindings on aliases, make sure to follow the alias.
Change-Id: I860a5bf6b5aba838727385f26e50e3d1bf0c8ea8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index cbbe54e9de..e63d6a9f21 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -691,7 +691,17 @@ bool QmlObjectCreator::setPropertyValue(QQmlPropertyData *property, int bindingI targetCorePropertyData = QQmlPropertyPrivate::saveValueType(*_valueTypeProperty, _qobject->metaObject(), property->coreIndex, engine); qmlBinding->setTarget(_bindingTarget, targetCorePropertyData, context); - qmlBinding->addToObject(); + + if (targetCorePropertyData.isAlias()) { + QQmlAbstractBinding *old = + QQmlPropertyPrivate::setBindingNoEnable(_bindingTarget, + targetCorePropertyData.coreIndex, + targetCorePropertyData.getValueTypeCoreIndex(), + qmlBinding); + if (old) { old->destroy(); } + } else { + qmlBinding->addToObject(); + } _createdBindings[bindingIndex] = qmlBinding; qmlBinding->m_mePtr = &_createdBindings[bindingIndex]; |