aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-01-07 12:55:39 +0100
committerThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-01-08 09:11:54 +0000
commitb7eafe9512ce448719b15fc3f337c8b5717bb93a (patch)
tree9148f854fa999d31d4e469447325b5723c403365 /src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
parent895550844d5df67284ba90527c21a17a300cb4b6 (diff)
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>
Diffstat (limited to 'src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp')
-rw-r--r--src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
index 493f762afd..be3320c661 100644
--- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
+++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
@@ -751,6 +751,21 @@ const CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() const
// maybe 'type' is a cpp name
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;
}