diff options
Diffstat (limited to 'src/corelib/tools/qbitarray.cpp')
-rw-r--r-- | src/corelib/tools/qbitarray.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index 4ef066cf8b..96811cc179 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -725,6 +725,24 @@ QDataStream &operator>>(QDataStream &in, QBitArray &ba) } #endif // QT_NO_DATASTREAM +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QBitArray &array) +{ + dbg.nospace() << "QBitArray("; + for (int i = 0; i < array.size();) { + if (array.testBit(i)) + dbg.nospace() << '1'; + else + dbg.nospace() << '0'; + i += 1; + if (!(i % 4) && (i < array.size())) + dbg.nospace() << ' '; + } + dbg.nospace() << ')'; + return dbg.space(); +} +#endif + /*! \fn DataPtr &QBitArray::data_ptr() \internal |