diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/plugin/quuid.cpp | 9 | ||||
-rw-r--r-- | src/corelib/plugin/quuid.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qbitarray.cpp | 18 | ||||
-rw-r--r-- | src/corelib/tools/qbitarray.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 10 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 10 | ||||
-rw-r--r-- | src/corelib/tools/qregexp.h | 4 |
8 files changed, 63 insertions, 0 deletions
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index 1cf171f663..46589f88bc 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -43,6 +43,7 @@ #include "qdatastream.h" #include "qendian.h" +#include "qdebug.h" QT_BEGIN_NAMESPACE @@ -918,6 +919,14 @@ QUuid QUuid::createUuid() guid; otherwise returns false. */ +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QUuid &id) +{ + dbg.nospace() << "QUuid(" << id.toString() << ')'; + return dbg.space(); +} +#endif + /** Returns a hash of the QUuid */ diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h index e7cc919ad5..2eec1575e5 100644 --- a/src/corelib/plugin/quuid.h +++ b/src/corelib/plugin/quuid.h @@ -189,6 +189,10 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QUuid &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QUuid &); #endif +#ifndef QT_NO_DEBUG_STREAM +Q_CORE_EXPORT QDebug operator<<(QDebug, const QUuid &); +#endif + Q_CORE_EXPORT uint qHash(const QUuid &uuid); QT_END_NAMESPACE 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 diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h index 29abf19573..83c81eca90 100644 --- a/src/corelib/tools/qbitarray.h +++ b/src/corelib/tools/qbitarray.h @@ -170,6 +170,10 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QBitArray &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QBitArray &); #endif +#ifndef QT_NO_DEBUG_STREAM +Q_CORE_EXPORT QDebug operator<<(QDebug, const QBitArray &); +#endif + Q_DECLARE_TYPEINFO(QBitArray, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QBitArray) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index d9777433d4..1dc384985b 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -56,6 +56,7 @@ QT_END_NAMESPACE #include "qplatformdefs.h" #include "qdatastream.h" +#include "qdebug.h" #include "qstring.h" #include "qlocale.h" #include "qlocale_p.h" @@ -3325,4 +3326,13 @@ QString QLocale::nativeCountryName() const return getLocaleData(endonyms_data + d()->m_country_endonym_idx, d()->m_country_endonym_size); } +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QLocale &l) +{ + dbg.nospace() << "QLocale(" << qPrintable(QLocale::languageToString(l.language())) + << ", " << qPrintable(QLocale::scriptToString(l.script())) + << ", " << qPrintable(QLocale::countryToString(l.country())) << ')'; + return dbg.space(); +} +#endif QT_END_NAMESPACE diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index 100dcc9722..9bc4ea70b8 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -806,6 +806,10 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QLocale &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QLocale &); #endif +#ifndef QT_NO_DEBUG_STREAM +Q_CORE_EXPORT QDebug operator<<(QDebug, const QLocale &); +#endif + QT_END_NAMESPACE #ifndef QT_NO_SYSTEMLOCALE diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 9be494472f..d300ed967d 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -45,6 +45,7 @@ #include "qbitarray.h" #include "qcache.h" #include "qdatastream.h" +#include "qdebug.h" #include "qlist.h" #include "qmap.h" #include "qmutex.h" @@ -4571,4 +4572,13 @@ QDataStream &operator>>(QDataStream &in, QRegExp ®Exp) } #endif // QT_NO_DATASTREAM +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QRegExp &r) +{ + dbg.nospace() << "QRegExp(patternSyntax=" << r.patternSyntax() + << ", pattern='"<< r.pattern() << "')"; + return dbg.space(); +} +#endif + QT_END_NAMESPACE diff --git a/src/corelib/tools/qregexp.h b/src/corelib/tools/qregexp.h index 583fa15a5f..364745e24a 100644 --- a/src/corelib/tools/qregexp.h +++ b/src/corelib/tools/qregexp.h @@ -127,6 +127,10 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &out, const QRegExp ®Exp); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &in, QRegExp ®Exp); #endif +#ifndef QT_NO_DEBUG_STREAM +Q_CORE_EXPORT QDebug operator<<(QDebug, const QRegExp &); +#endif + QT_END_NAMESPACE QT_END_HEADER |