aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/ApiExtractor/documentation.cpp21
-rw-r--r--sources/shiboken6/ApiExtractor/documentation.h6
2 files changed, 27 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/documentation.cpp b/sources/shiboken6/ApiExtractor/documentation.cpp
index f4c016d97..52d7051ac 100644
--- a/sources/shiboken6/ApiExtractor/documentation.cpp
+++ b/sources/shiboken6/ApiExtractor/documentation.cpp
@@ -28,6 +28,8 @@
#include "documentation.h"
+#include <QtCore/QDebug>
+
Documentation::Documentation(const QString &detailed,
const QString &brief,
Format fmt) :
@@ -73,3 +75,22 @@ void Documentation::setBrief(const QString &brief)
{
m_brief = brief.trimmed();
}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const Documentation &d)
+{
+ QDebugStateSaver saver(debug);
+ debug.noquote();
+ debug.nospace();
+ debug << "Documentation(";
+ if (!d.isEmpty()) {
+ debug << "format=" << d.format();
+ if (!d.brief().isEmpty())
+ debug << ", brief=\"" << d.brief() << '"';
+ if (!d.detailed().isEmpty())
+ debug << ", detailed=\"" << d.detailed() << '"';
+ }
+ debug << ')';
+ return debug;
+}
+#endif // QT_NO_DEBUG_STREAM
diff --git a/sources/shiboken6/ApiExtractor/documentation.h b/sources/shiboken6/ApiExtractor/documentation.h
index df2a3fd6f..1769bc071 100644
--- a/sources/shiboken6/ApiExtractor/documentation.h
+++ b/sources/shiboken6/ApiExtractor/documentation.h
@@ -31,6 +31,8 @@
#include <QtCore/QString>
+QT_FORWARD_DECLARE_CLASS(QDebug)
+
class Documentation
{
public:
@@ -77,4 +79,8 @@ inline bool operator==(const Documentation &d1, const Documentation &d2)
inline bool operator!=(const Documentation &d1, const Documentation &d2)
{ return !d1.equals(d2); }
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const Documentation &);
+#endif
+
#endif // DOCUMENTATION_H