diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-12-16 15:38:27 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-12-16 19:25:43 +0100 |
| commit | 2dfad0e37f3fa962591e16e98fb5feb262c06f1c (patch) | |
| tree | 7c79f99013b2a0e544b6a90eed1e6cc516b72732 | |
| parent | be04c2df4202bcf2086348380da91fcfb28397d6 (diff) | |
shiboken6: Improve debug operator of OverloadData
Output signature of reference function, indicate
whether it is a reverse operator. Output other functions
only when present.
Change-Id: I188b4c53e9b488863fad64c42608f2f819d77ac0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| -rw-r--r-- | sources/shiboken6/generator/shiboken/overloaddata.cpp | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/sources/shiboken6/generator/shiboken/overloaddata.cpp b/sources/shiboken6/generator/shiboken/overloaddata.cpp index 1ff9a74a8..d75814833 100644 --- a/sources/shiboken6/generator/shiboken/overloaddata.cpp +++ b/sources/shiboken6/generator/shiboken/overloaddata.cpp @@ -1027,19 +1027,31 @@ AbstractMetaArgumentList OverloadData::getArgumentsWithDefaultValues(const Abstr #ifndef QT_NO_DEBUG_STREAM void OverloadData::formatDebug(QDebug &d) const { - const int count = m_overloads.size(); - d << "argType=" << m_argType << ", minArgs=" << m_minArgs << ", maxArgs=" << m_maxArgs - << ", argPos=" << m_argPos << ", argTypeReplaced=\"" << m_argTypeReplaced - << "\", overloads[" << count << "]=("; - const int oldVerbosity = d.verbosity(); - d.setVerbosity(3); - for (int i = 0; i < count; ++i) { - if (i) - d << '\n'; - d << m_overloads.at(i); - } - d << ')'; - d.setVerbosity(oldVerbosity); + const qsizetype count = m_overloads.size(); + auto refFunc = referenceFunction(); + d << '"'; + if (auto owner = refFunc->ownerClass()) + d << owner->qualifiedCppName() << "::"; + d << refFunc->minimalSignature() << '"'; + if (m_overloads.constFirst()->isReverseOperator()) + d << " [reverseop]"; + d << ", argType=" << m_argType << ", minArgs=" << m_minArgs << ", maxArgs=" << m_maxArgs + << ", argPos=" << m_argPos; + if (!m_argTypeReplaced.isEmpty()) + d << ", argTypeReplaced=\"" << m_argTypeReplaced << '"'; + + if (count < 2) + return; + d << "\", overloads[" << count << "]=("; + const int oldVerbosity = d.verbosity(); + d.setVerbosity(3); + for (int i = 0; i < count; ++i) { + if (i) + d << '\n'; + d << m_overloads.at(i); + } + d.setVerbosity(oldVerbosity); + d << ')'; } QDebug operator<<(QDebug d, const OverloadData *od) |
