Commit 2ae1f0cc authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.metaSystem: fix fot Qt Components



In the case of "." imports we loose the package name.
This patches "maps back" to QtQuick by default or maps to <cpp>
if the package name is empty.

Change-Id: Ibe8d782541d109049f3480c7dfd15de69d75da38
Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
parent 8be83a17
......@@ -826,6 +826,7 @@ void NodeMetaInfoPrivate::setupPrototypes()
objects = PrototypeIterator(getObjectValue(), context()).all();
else
objects = PrototypeIterator(getQmlObjectValue(), context()).all();
foreach (const ObjectValue *ov, objects) {
TypeDescription description;
description.className = ov->className();
......@@ -834,8 +835,15 @@ void NodeMetaInfoPrivate::setupPrototypes()
if (const QmlObjectValue * qmlValue = dynamic_cast<const QmlObjectValue *>(ov)) {
description.minorVersion = qmlValue->componentVersion().minorVersion();
description.majorVersion = qmlValue->componentVersion().majorVersion();
if (!qmlValue->moduleName().isEmpty())
LanguageUtils::FakeMetaObject::Export qtquickExport = qmlValue->metaObject()->exportInPackage("QtQuick");
LanguageUtils::FakeMetaObject::Export cppExport = qmlValue->metaObject()->exportInPackage("<cpp>");
if (qtquickExport.isValid()) {
description.className = qtquickExport.package + '.' + qtquickExport.type;
} else if (qmlValue->moduleName().isEmpty() && cppExport.isValid()) {
description.className = cppExport.package + '.' + cppExport.type;
} else if (!qmlValue->moduleName().isEmpty()) {
description.className = qmlValue->moduleName() + '.' + description.className;
}
m_prototypes.append(description);
} else {
if (context()->lookupType(document(), QStringList() << ov->className()))
......
Supports Markdown
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