aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/documentation.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-03-14 09:10:43 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-03-14 15:50:11 +0100
commit38fe8062b6f03dae438dc4e42537c131a98eceb0 (patch)
tree2c14eb91a9bb57691d500c71588fb952bf2f402c /sources/shiboken6/ApiExtractor/documentation.cpp
parent216c7802c393995acce063da48300b06caa23eb1 (diff)
shiboken6: Add a debug operator for Documentation
Pick-to: 6.2 Change-Id: Ia57e2903cfb7f5f8340bb27b58d7dfc2fb06c026 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/documentation.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/documentation.cpp21
1 files changed, 21 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