src/corelib/io/qdebug.h
changeset 33 3e2da88830cd
parent 18 2f34d5167611
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
   252     }
   252     }
   253     debug << ')';
   253     debug << ')';
   254     return debug.space();
   254     return debug.space();
   255 }
   255 }
   256 
   256 
       
   257 #if defined(FORCE_UREF)
       
   258 template <class T>
       
   259 inline QDebug &operator<<(QDebug debug, const QFlags<T> &flags)
       
   260 #else
       
   261 template <class T>
       
   262 inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
       
   263 #endif
       
   264 {
       
   265     debug.nospace() << "QFlags(";
       
   266     bool needSeparator = false;
       
   267     for (uint i = 0; i < sizeof(T) * 8; ++i) {
       
   268         if (flags.testFlag(T(1 << i))) {
       
   269             if (needSeparator)
       
   270                 debug.nospace() << '|';
       
   271             else
       
   272                 needSeparator = true;
       
   273             debug.nospace() << "0x" << QByteArray::number(T(1 << i), 16).constData();
       
   274         }
       
   275     }
       
   276     debug << ')';
       
   277     return debug.space();
       
   278 }
       
   279 
   257 #if !defined(QT_NO_DEBUG_STREAM)
   280 #if !defined(QT_NO_DEBUG_STREAM)
   258 Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); }
   281 Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); }
   259 
   282 
   260 #else // QT_NO_DEBUG_STREAM
   283 #else // QT_NO_DEBUG_STREAM
   261 #undef qDebug
   284 #undef qDebug