Core: Add debug stream operator for Core::Id

Change-Id: Ieeb299709d9e18d1db0632b245b735fe07230a89
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
David Schulz
2015-06-16 10:49:46 +02:00
parent 4fb6d71263
commit 5bc35c5dfa
2 changed files with 6 additions and 1 deletions

View File

@@ -349,7 +349,6 @@ QString Id::suffixAfter(Id baseId) const
} // namespace Core
QT_BEGIN_NAMESPACE
QDataStream &operator<<(QDataStream &ds, Core::Id id)
@@ -365,4 +364,9 @@ QDataStream &operator>>(QDataStream &ds, Core::Id &id)
return ds;
}
QDebug operator<<(QDebug dbg, const Core::Id &id)
{
return dbg << id.name();
}
QT_END_NAMESPACE

View File

@@ -92,6 +92,7 @@ Q_DECLARE_METATYPE(QList<Core::Id>)
QT_BEGIN_NAMESPACE
QDataStream &operator<<(QDataStream &ds, Core::Id id);
QDataStream &operator>>(QDataStream &ds, Core::Id &id);
CORE_EXPORT QDebug operator<<(QDebug dbg, const Core::Id &id);
QT_END_NAMESPACE
#endif // CORE_ID_H