From c87bb03e5eb53b7a33a8501b8f5b4227ec7ddd57 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 24 Jun 2015 15:25:11 +0200 Subject: QDebug: add missing docs for op<<(Container) Change-Id: I9f89d8e792bf0d432a0b2522f26026c6ad81e2f4 Reviewed-by: Thiago Macieira --- src/corelib/io/qdebug.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++++++ src/corelib/io/qdebug.h | 16 +++++++------- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 30086b2dac..6b8f832eed 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -668,6 +668,62 @@ QDebug &QDebug::resetFormat() \internal */ +/*! + \fn QDebug operator<<(QDebug stream, const QList &list) + \relates QDebug + + Writes the contents of \a list to \a stream. \c T needs to + support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QVector &vector) + \relates QDebug + + Writes the contents of \a vector to \a stream. \c T needs to + support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QSet &set) + \relates QDebug + + Writes the contents of \a set to \a stream. \c T needs to + support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QMap &map) + \relates QDebug + + Writes the contents of \a map to \a stream. Both \c Key and + \c T need to support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QHash &hash) + \relates QDebug + + Writes the contents of \a hash to \a stream. Both \c Key and + \c T need to support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QPair &pair) + \relates QDebug + + Writes the contents of \a pair to \a stream. Both \c T1 and + \c T2 need to support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QFlags &flag) + \relates QDebug + \since 4.7 + + Writes \a flag to \a stream. +*/ + /*! \class QDebugStateSaver diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 3c3ceba249..7c75608e2a 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -201,12 +201,12 @@ inline QDebug operator<<(QDebug debug, const QVector &vec) return operator<<(debug, vec.toList()); } -template -inline QDebug operator<<(QDebug debug, const QMap &map) +template +inline QDebug operator<<(QDebug debug, const QMap &map) { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QMap("; - for (typename QMap::const_iterator it = map.constBegin(); + for (typename QMap::const_iterator it = map.constBegin(); it != map.constEnd(); ++it) { debug << '(' << it.key() << ", " << it.value() << ')'; } @@ -215,12 +215,12 @@ inline QDebug operator<<(QDebug debug, const QMap &map) return debug.maybeSpace(); } -template -inline QDebug operator<<(QDebug debug, const QHash &hash) +template +inline QDebug operator<<(QDebug debug, const QHash &hash) { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QHash("; - for (typename QHash::const_iterator it = hash.constBegin(); + for (typename QHash::const_iterator it = hash.constBegin(); it != hash.constEnd(); ++it) debug << '(' << it.key() << ", " << it.value() << ')'; debug << ')'; @@ -261,7 +261,7 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache &cache) return debug.maybeSpace(); } -#ifndef QT_NO_QOBJECT +#if !defined(QT_NO_QOBJECT) && !defined(Q_QDOC) Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug&, int value, const QMetaObject *meta, const char *name); Q_CORE_EXPORT QDebug qt_QMetaEnum_flagDebugOperator(QDebug &dbg, quint64 value, const QMetaObject *meta, const char *name); @@ -290,7 +290,7 @@ inline typename QtPrivate::QEnableIf< !QtPrivate::IsQEnumHelper::Value && !QtPrivate::IsQEnumHelper >::Value, QDebug>::Type qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags &flags) -#else // !QT_NO_QOBJECT +#else // !QT_NO_QOBJECT && !Q_QDOC template inline QDebug qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags &flags) #endif -- cgit v1.2.3