Commit af1231b6 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.SubComponentManager: We have to use importPaths

Otherwise we skip items derived from types only available via imports.

Change-Id: I102a4843652029dff777e12594efc4d5e5e50999
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent 2ee3bae4
......@@ -108,7 +108,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName)
snapshot.insert(document);
QmlJS::Link link(snapshot, QStringList(), QmlJS::ModelManagerInterface::instance()->builtins(document));
QmlJS::Link link(snapshot, modelManager->importPaths(), QmlJS::ModelManagerInterface::instance()->builtins(document));
QList<QmlJS::DiagnosticMessage> diagnosticLinkMessages;
QmlJS::ContextPtr context = link(document, &diagnosticLinkMessages);
......@@ -123,15 +123,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName)
if (!definition)
return false;
QString fullTypeName;
for (QmlJS::AST::UiQualifiedId *iter = definition->qualifiedTypeNameId; iter; iter = iter->next)
if (!iter->name.isEmpty())
fullTypeName += iter->name.toString() + QLatin1Char('.');
if (fullTypeName.endsWith(QLatin1Char('.')))
fullTypeName.chop(1);
const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), fullTypeName.split('.'));
const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), definition->qualifiedTypeNameId);
QList<const QmlJS::ObjectValue *> prototypes = QmlJS::PrototypeIterator(objectValue, context).all();
......
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