From 4bd9cf381e4efb00b2a0ab0502f622cf2b6db76d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 1 Jul 2019 17:58:46 +0300 Subject: [PATCH] QDataStream streaming operator for QFlags added only since Qt 5.9. --HG-- branch : develop --- src/libs/vmisc/vdatastreamenum.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libs/vmisc/vdatastreamenum.h b/src/libs/vmisc/vdatastreamenum.h index b158e80b2..77b3c228c 100644 --- a/src/libs/vmisc/vdatastreamenum.h +++ b/src/libs/vmisc/vdatastreamenum.h @@ -56,4 +56,18 @@ QDataStream& operator>>(QDataStream& stream, Enum& e) return stream; } +#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) +template +inline QDataStream &operator<<(QDataStream &s, QFlags e) +{ + return s << e.i; +} + +template +inline QDataStream &operator>>(QDataStream &s, QFlags &e) +{ + return s >> e.i; +} +#endif + #endif // DATASTREAM_ENUM_H