diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-09 09:22:06 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-09 12:27:54 +0100 |
commit | 4df39cb75da522e5daff583e6fc11ca897969628 (patch) | |
tree | 5889eef5ee57447d3452561cf2fba2050569229b | |
parent | a75527289b0d2bbb3a13d34e24fbce1be42601f9 (diff) |
dumpcodemodel: Qualify function arguments
Amends d1604053e9ae354963a2b2447b3d196fc5dda73e.
Task-number: PYSIDE-1240
Change-Id: I27882de3077fcd11fc98b10b8ddbd469990b77c4
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.cpp | 29 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.h | 2 |
2 files changed, 30 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp index 4fafa0c2c..fdf2af872 100644 --- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp +++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp @@ -393,6 +393,33 @@ void TypeInfo::simplifyStdType() } } +void TypeInfo::formatTypeSystemSignature(QTextStream &str) const +{ + if (m_constant) + str << "const "; + str << m_qualifiedName.join(QLatin1String("::")); + switch (m_referenceType) { + case NoReference: + break; + case LValueReference: + str << '&'; + break; + case RValueReference: + str << "&&"; + break; + } + for (auto i : m_indirections) { + switch (i) { + case Indirection::Pointer: + str << '*'; + break; + case Indirection::ConstPointer: + str << "* const"; + break; + } + } +} + #ifndef QT_NO_DEBUG_STREAM template <class It> void formatSequence(QDebug &d, It i1, It i2, const char *separator=", ") @@ -1135,7 +1162,7 @@ QString _FunctionModelItem::typeSystemSignature() const // For dumping out type for (int a = 0, size = m_arguments.size(); a < size; ++a) { if (a) str << ','; - str << m_arguments.at(a)->type().qualifiedName().join(QLatin1String("::")); + m_arguments.at(a)->type().formatTypeSystemSignature(str); } str << ')'; return result; diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.h b/sources/shiboken2/ApiExtractor/parser/codemodel.h index e851c9c8e..57b393f91 100644 --- a/sources/shiboken2/ApiExtractor/parser/codemodel.h +++ b/sources/shiboken2/ApiExtractor/parser/codemodel.h @@ -202,6 +202,8 @@ public: static TypeInfo combine(const TypeInfo &__lhs, const TypeInfo &__rhs); static TypeInfo resolveType(TypeInfo const &__type, const ScopeModelItem &__scope); + void formatTypeSystemSignature(QTextStream &str) const; + #ifndef QT_NO_DEBUG_STREAM void formatDebug(QDebug &d) const; #endif |