diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-05-02 11:47:55 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-10 02:49:46 +0200 |
commit | 527b700f73c3bc114ba092418ee48626e95014a3 (patch) | |
tree | 6a8fb41652cb604d7f88430e84b7f27bb14cb9cd /src/qml/qml/qqmlcompiler.cpp | |
parent | 319007117a8fafe9a72230bbc13fb18833ff4a16 (diff) |
Allow V4 bindings to be assigned to aliases
V4 bindings must be able to be retargetted for them to be assignable
to aliases.
Change-Id: I4d3addd0fdc90b9bf472c781d316f7f406eaf1d7
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler.cpp')
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index e409544c96..d5775b63f4 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -3428,6 +3428,7 @@ void QQmlCompiler::genBindingAssignment(QQmlScript::Value *binding, store.value = js.compiledIndex; store.context = js.bindingContext.stack; store.owner = js.bindingContext.owner; + store.isAlias = prop->isAlias; if (valueTypeProperty) { store.property = (valueTypeProperty->index & 0xFFFF) | ((valueTypeProperty->type & 0xFF)) << 16 | @@ -3542,21 +3543,18 @@ bool QQmlCompiler::completeComponentBuild() JSBindingReference &binding = *b; - // ### We don't currently optimize for bindings on alias's - because - // of the solution to QTBUG-13719 - if (!binding.property->isAlias) { - expr.context = binding.bindingContext.object; - expr.property = binding.property; - expr.expression = binding.expression; - - int index = bindingCompiler.compile(expr, enginePrivate); - if (index != -1) { - binding.dataType = BindingReference::V4; - binding.compiledIndex = index; - if (componentStats) - componentStats->componentStat.optimizedBindings.append(b->value->location); - continue; - } + // First try v4 + expr.context = binding.bindingContext.object; + expr.property = binding.property; + expr.expression = binding.expression; + + int index = bindingCompiler.compile(expr, enginePrivate); + if (index != -1) { + binding.dataType = BindingReference::V4; + binding.compiledIndex = index; + if (componentStats) + componentStats->componentStat.optimizedBindings.append(b->value->location); + continue; } // Pre-rewrite the expression |