diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-05 10:21:52 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-05 15:01:07 +0100 |
commit | 247f6a34d161f10c4f6d5d516b8bfb7043ca78a2 (patch) | |
tree | 4d7c89e3b4f33279a3565d5afdb925dc21b58ba0 /src/qml/compiler/qqmltypecompiler.cpp | |
parent | c8889fbb5561d75a7a383b86daa89c1b264c6f6e (diff) |
[new compiler] Fix auto component creation with composite types
A binding like this
property Component foo: SomeComposite {}
should not do an implicit component insertion if SomeComposite is actually
a component. The property assignment is compatible and can proceed normally.
Fixes tst_qquickcanvasitem, but added a separate unit test for this case.
Change-Id: I7221eebd38dba3f2a82b59341739b9b67211e352
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler.cpp')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index fd3d8a92e3..f6eb4bc40e 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -1275,9 +1275,13 @@ void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents(const QtQm const QtQml::QmlObject *targetObject = qmlObjects->at(binding->value.objectIndex); QQmlCompiledData::TypeReference *tr = resolvedTypes->value(targetObject->inheritedTypeNameIndex); Q_ASSERT(tr); - QQmlType *targetType = tr->type; - if (targetType && targetType->metaObject() == &QQmlComponent::staticMetaObject) - continue; + if (QQmlType *targetType = tr->type) { + if (targetType->metaObject() == &QQmlComponent::staticMetaObject) + continue; + } else if (tr->component) { + if (tr->component->rootPropertyCache->firstCppMetaObject() == &QQmlComponent::staticMetaObject) + continue; + } QQmlPropertyData *pd = 0; if (binding->propertyNameIndex != 0) { |