forked from qt-creator/qt-creator
QmlDesigner: Ensure that QQuickItem is always used from the QtQuick export
The code model creates multiple exports for QQuickItem, but to be able to identify it as QtQuick.Item we have to always use the QtQuick export. Change-Id: Ife567cfb368092f818c7cf418ede4ab1bca227fa Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com> Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -751,6 +751,21 @@ const CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() const
|
|||||||
// maybe 'type' is a cpp name
|
// maybe 'type' is a cpp name
|
||||||
const CppComponentValue *cppValue = context()->valueOwner()->cppQmlTypes().objectByCppName(type);
|
const CppComponentValue *cppValue = context()->valueOwner()->cppQmlTypes().objectByCppName(type);
|
||||||
|
|
||||||
|
if (cppValue) {
|
||||||
|
foreach (const LanguageUtils::FakeMetaObject::Export &exportValue, cppValue->metaObject()->exports()) {
|
||||||
|
if (exportValue.package.toUtf8() != "<cpp>") {
|
||||||
|
foreach (const QmlJS::Import &import, context()->imports(document())->all()) {
|
||||||
|
if (import.info.path() != exportValue.package)
|
||||||
|
continue;
|
||||||
|
const Value *lookupResult = import.object->lookupMember(exportValue.type, context());
|
||||||
|
const CppComponentValue *cppValue = value_cast<CppComponentValue>(lookupResult);
|
||||||
|
if (cppValue)
|
||||||
|
return cppValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return cppValue;
|
return cppValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user