diff -r 5dc02b23752f -r 3e2da88830cd src/corelib/io/qdebug.h --- a/src/corelib/io/qdebug.h Tue Jul 06 15:10:48 2010 +0300 +++ b/src/corelib/io/qdebug.h Wed Aug 18 10:37:55 2010 +0300 @@ -254,6 +254,29 @@ return debug.space(); } +#if defined(FORCE_UREF) +template +inline QDebug &operator<<(QDebug debug, const QFlags &flags) +#else +template +inline QDebug operator<<(QDebug debug, const QFlags &flags) +#endif +{ + debug.nospace() << "QFlags("; + bool needSeparator = false; + for (uint i = 0; i < sizeof(T) * 8; ++i) { + if (flags.testFlag(T(1 << i))) { + if (needSeparator) + debug.nospace() << '|'; + else + needSeparator = true; + debug.nospace() << "0x" << QByteArray::number(T(1 << i), 16).constData(); + } + } + debug << ')'; + return debug.space(); +} + #if !defined(QT_NO_DEBUG_STREAM) Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); }