From 4df39cb75da522e5daff583e6fc11ca897969628 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 9 Mar 2020 09:22:06 +0100 Subject: dumpcodemodel: Qualify function arguments Amends d1604053e9ae354963a2b2447b3d196fc5dda73e. Task-number: PYSIDE-1240 Change-Id: I27882de3077fcd11fc98b10b8ddbd469990b77c4 Reviewed-by: Christian Tismer --- .../shiboken2/ApiExtractor/parser/codemodel.cpp | 29 +++++++++++++++++++++- sources/shiboken2/ApiExtractor/parser/codemodel.h | 2 ++ 2 files changed, 30 insertions(+), 1 deletion(-) 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 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 -- cgit v1.2.3