Core: Add streaming operators for Core::Id

Only used once so far, but makes intended usage clear.

Change-Id: Ia628f5356dd02282e233846268d6c0629e93e3fe
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
hjk
2013-03-19 19:01:30 +01:00
committed by Eike Ziller
parent aefea10c9c
commit dcfc617cc8
3 changed files with 27 additions and 4 deletions

View File

@@ -354,3 +354,21 @@ QString Id::suffixAfter(Id baseId) const
}
} // namespace Core
QT_BEGIN_NAMESPACE
QDataStream &operator<<(QDataStream &ds, const Core::Id &id)
{
return ds << id.name();
}
QDataStream &operator>>(QDataStream &ds, Core::Id &id)
{
QByteArray ba;
ds >> ba;
id = Core::Id::fromName(ba);
return ds;
}
QT_END_NAMESPACE