aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetabuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'abstractmetabuilder.cpp')
-rw-r--r--abstractmetabuilder.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index bf9fca0d7..2ceb7b247 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -1816,8 +1816,21 @@ AbstractMetaType* AbstractMetaBuilder::translateType(const TypeInfo& _typei, boo
if (qualifiedName == "QFlags")
qualifiedName = typeInfo.toString();
+ const TypeEntry *type = 0;
// 5. Try to find the type
- const TypeEntry *type = TypeDatabase::instance()->findType(qualifiedName);
+
+ // 5.1 - Try first using the current scope
+ if (m_currentClass) {
+ QStringList context = m_currentClass->qualifiedCppName().split("::");
+ while(!type && (context.size() > 0) ) {
+ type = TypeDatabase::instance()->findType(context.join("::") + "::" + qualifiedName);
+ context.removeLast();
+ }
+ }
+
+ // 5.2 - Try without scope
+ if (!type)
+ type = TypeDatabase::instance()->findType(qualifiedName);
// 6. No? Try looking it up as a flags type
if (!type)