diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-01-25 14:11:33 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-07-04 03:04:09 +0000 |
commit | 71e41d7230650e4b25cfe0f2ac8e3c87e8e4119e (patch) | |
tree | e0a451776b9fddd08d31b2c6fe6641cee60f51c8 /src/corelib/serialization/qcborcommon.h | |
parent | 9be00330af639043961f4d7b8ee1d3511e787931 (diff) |
CBOR: Add QDebug operators for the Qt CBOR value-like types
I added a function that returns the string identifiers for
QCborKnownTags and QCborSimpleType, in order to facilitate writing a
QTest::toString for those types, as neither enum is part of a Q_OBJECT
or Q_GADGET class.
Change-Id: I56b444f9d6274221a3b7fffd150d2d26a1925c19
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/serialization/qcborcommon.h')
-rw-r--r-- | src/corelib/serialization/qcborcommon.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/serialization/qcborcommon.h b/src/corelib/serialization/qcborcommon.h index fe77e65a67..95e40ccedc 100644 --- a/src/corelib/serialization/qcborcommon.h +++ b/src/corelib/serialization/qcborcommon.h @@ -42,6 +42,7 @@ #include <QtCore/qobjectdefs.h> #include <QtCore/qmetatype.h> +#include <QtCore/qdebug.h> #if 0 #pragma qt_class(QtCborCommon) @@ -119,6 +120,12 @@ public: QString toString() const; }; +#if !defined(QT_NO_DEBUG_STREAM) +Q_CORE_EXPORT QDebug operator<<(QDebug, QCborSimpleType st); +Q_CORE_EXPORT QDebug operator<<(QDebug, QCborKnownTags tg); +Q_CORE_EXPORT QDebug operator<<(QDebug, QCborTag tg); +#endif + QT_END_NAMESPACE Q_DECLARE_METATYPE(QCborSimpleType) |