QDataStream streaming operator for QFlags added only since Qt 5.9.
--HG-- branch : develop
This commit is contained in:
parent
f8dddca99f
commit
4bd9cf381e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user