Commit ad900e17 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.MetaInfo: Properly resolve prototypes from different plugins



If there is a non <cpp> export for the CppComponentValue
we use it.

Task-number: QTCREATORBUG-11205
Change-Id: Ia82c8fc5f567245f5d04b0fd91819bf443312e17
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent b0c5380d
......@@ -1031,12 +1031,27 @@ void NodeMetaInfoPrivate::setupPrototypes()
description.majorVersion = qmlValue->componentVersion().majorVersion();
LanguageUtils::FakeMetaObject::Export qtquickExport = qmlValue->metaObject()->exportInPackage("QtQuick");
LanguageUtils::FakeMetaObject::Export cppExport = qmlValue->metaObject()->exportInPackage("<cpp>");
if (qtquickExport.isValid())
if (qtquickExport.isValid()) {
description.className = qtquickExport.package.toUtf8() + '.' + qtquickExport.type.toUtf8();
else if (qmlValue->moduleName().isEmpty() && cppExport.isValid())
description.className = cppExport.package.toUtf8() + '.' + cppExport.type.toUtf8();
else if (!qmlValue->moduleName().isEmpty())
description.className = qmlValue->moduleName().toUtf8() + '.' + description.className;
} else {
bool found = false;
if (cppExport.isValid()) {
foreach (const LanguageUtils::FakeMetaObject::Export &exportValue, qmlValue->metaObject()->exports()) {
if (exportValue.package.toUtf8() != "<cpp>") {
found = true;
description.className = exportValue.package.toUtf8() + '.' + exportValue.type.toUtf8();
}
}
}
if (!found) {
if (qmlValue->moduleName().isEmpty() && cppExport.isValid()) {
description.className = cppExport.package.toUtf8() + '.' + cppExport.type.toUtf8();
} else if (!qmlValue->moduleName().isEmpty()) {
description.className = qmlValue->moduleName().toUtf8() + '.' + description.className;
}
}
}
m_prototypes.append(description);
} else {
if (context()->lookupType(document(), QStringList() << ov->className())) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment