diff options
Diffstat (limited to 'src/qmlcompiler/qqmljsscope_p.h')
-rw-r--r-- | src/qmlcompiler/qqmljsscope_p.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h index 46aee20d90..6047d0c1d9 100644 --- a/src/qmlcompiler/qqmljsscope_p.h +++ b/src/qmlcompiler/qqmljsscope_p.h @@ -278,10 +278,30 @@ public: { using namespace Qt::StringLiterals; - QString suffix; - if (m_semantics == AccessSemantics::Reference) - suffix = u" *"_s; - return m_internalName + suffix; + switch (m_semantics) { + case AccessSemantics::Reference: + return m_internalName + " *"_L1; + case AccessSemantics::Value: + case AccessSemantics::Sequence: + break; + case AccessSemantics::None: + // If we got a namespace, it might still be a regular type, exposed as namespace. + // We may need to travel the inheritance chain all the way up to QObject to + // figure this out, since all other types may be exposed the same way. + for (QQmlJSScope::ConstPtr base = baseType(); base; base = base->baseType()) { + switch (base->accessSemantics()) { + case AccessSemantics::Reference: + return m_internalName + " *"_L1; + case AccessSemantics::Value: + case AccessSemantics::Sequence: + return m_internalName; + case AccessSemantics::None: + break; + } + } + break; + } + return m_internalName; } // This returns a more user readable version of internalName / baseTypeName |