diff options
-rw-r--r-- | generator/shiboken2/overloaddata.cpp | 32 | ||||
-rw-r--r-- | generator/shiboken2/overloaddata.h | 9 |
2 files changed, 41 insertions, 0 deletions
diff --git a/generator/shiboken2/overloaddata.cpp b/generator/shiboken2/overloaddata.cpp index 203918f..3bffc5b 100644 --- a/generator/shiboken2/overloaddata.cpp +++ b/generator/shiboken2/overloaddata.cpp @@ -1045,3 +1045,35 @@ AbstractMetaArgumentList OverloadData::getArgumentsWithDefaultValues(const Abstr return args; } +#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); +} + +QDebug operator<<(QDebug d, const OverloadData *od) +{ + QDebugStateSaver saver(d); + d.noquote(); + d.nospace(); + d << "OverloadData("; + if (od) + od->formatDebug(d); + else + d << '0'; + d << ')'; + return d; +} +#endif // !QT_NO_DEBUG_STREAM diff --git a/generator/shiboken2/overloaddata.h b/generator/shiboken2/overloaddata.h index 1985a73..959b96d 100644 --- a/generator/shiboken2/overloaddata.h +++ b/generator/shiboken2/overloaddata.h @@ -33,6 +33,8 @@ #include <QtCore/QList> #include <QtCore/QBitArray> +QT_FORWARD_DECLARE_CLASS(QDebug) + class ShibokenGenerator; class OverloadData; @@ -123,6 +125,10 @@ public: /// Returns a list of function arguments which have default values and were not removed. static AbstractMetaArgumentList getArgumentsWithDefaultValues(const AbstractMetaFunction* func); +#ifndef QT_NO_DEBUG_STREAM + void formatDebug(QDebug &) const; +#endif + private: OverloadData(OverloadData* headOverloadData, const AbstractMetaFunction* func, const AbstractMetaType* argType, int argPos); @@ -148,5 +154,8 @@ private: const ShibokenGenerator* m_generator; }; +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug, const OverloadData *); +#endif #endif // OVERLOADDATA_H |