QDataStream streaming operator for QFlags added only since Qt 5.9.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-07-01 17:58:46 +03:00
parent f8dddca99f
commit 4bd9cf381e

View File

@ -56,4 +56,18 @@ QDataStream& operator>>(QDataStream& stream, Enum& e)
return stream;
}
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
template <typename Enum>
inline QDataStream &operator<<(QDataStream &s, QFlags<Enum> e)
{
return s << e.i;
}
template <typename Enum>
inline QDataStream &operator>>(QDataStream &s, QFlags<Enum> &e)
{
return s >> e.i;
}
#endif
#endif // DATASTREAM_ENUM_H