summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetatype.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-07-01 17:05:36 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-07-09 06:40:08 +0200
commit2cfabed1ff9c822458c467ff072e7a3a6c0fbf3d (patch)
treed026d9135350af18d767f27481ac48534a5487b2 /src/corelib/kernel/qmetatype.cpp
parentf2c9f8c83781fea73b148bf24472f1d3d191c26e (diff)
Long live QDebug op<< QMetaType!
It's needed in QtHttpServer. [ChangeLog][QtCore][QDebug] Can now stream QMetaType. [ChangeLog][QtCore][QMetaType] Can now be streamed through QDebug. Change-Id: I974d77d678137715472a3907ab1e50ba2dbaa087 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.cpp')
-rw-r--r--src/corelib/kernel/qmetatype.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 780ae10396..2760a67e8a 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -1704,6 +1704,17 @@ void QMetaType::unregisterConverterFunction(QMetaType from, QMetaType to)
#ifndef QT_NO_DEBUG_STREAM
/*!
+ \fn QDebug QMetaType::operator<<(QDebug d, QMetaType m)
+ \since 6.5
+ Writes the QMetaType \a m to the stream \a d, and returns the stream.
+*/
+QDebug operator<<(QDebug d, QMetaType m)
+{
+ const QDebugStateSaver saver(d);
+ return d.nospace() << "QMetaType(" << m.name() << ")";
+}
+
+/*!
Streams the object at \a rhs to the debug stream \a dbg. Returns \c true
on success, otherwise false.
\since 5.2