Revert "QFlags: befriend the QDataStream serialization operators"
This reverts commits 729c0960b84183bcf9576f974cb5e3b3c3fdc6ef and 348b680ae56e92f061424a10c4baa726cf7f15d2. Friendship is not required. The removal of the forward-declaration in qflags.h implied adding it where it had been required but not present. Change-Id: Ie17963f95bb5fa98fd75fffd7e6e5289b58f1960 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit c7a069870ae80f47b32479dc1f8f7161a3238201) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b579f48790
commit
a5f12c1ff9
@ -12,7 +12,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QDataStream;
|
||||
template<typename Enum> class QFlags;
|
||||
|
||||
class QFlag
|
||||
@ -206,10 +205,6 @@ private:
|
||||
return (it == end ? Int(0) : (Int(*it) | initializer_list_helper(it + 1, end)));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DATASTREAM
|
||||
template <typename E> friend QDataStream &operator<<(QDataStream &, QFlags<E>);
|
||||
template <typename E> friend QDataStream &operator>>(QDataStream &, QFlags<E> &);
|
||||
#endif
|
||||
using Base::i;
|
||||
};
|
||||
|
||||
|
@ -517,11 +517,16 @@ inline QDataStream &QDataStream::operator<<(quint64 i)
|
||||
|
||||
template <typename Enum>
|
||||
inline QDataStream &operator<<(QDataStream &s, QFlags<Enum> e)
|
||||
{ return s << e.i; }
|
||||
{ return s << e.toInt(); }
|
||||
|
||||
template <typename Enum>
|
||||
inline QDataStream &operator>>(QDataStream &s, QFlags<Enum> &e)
|
||||
{ return s >> e.i; }
|
||||
{
|
||||
typename QFlags<Enum>::Int i;
|
||||
s >> i;
|
||||
e = QFlags<Enum>::fromInt(i);
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
typename std::enable_if_t<std::is_enum<T>::value, QDataStream &>
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
class QDataStream;
|
||||
class QString;
|
||||
|
||||
struct QLatin1Char
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QDataStream;
|
||||
class QLineF;
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -14,6 +14,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_ENABLE_P0846_SEMANTICS_FOR(get)
|
||||
|
||||
class QDataStream;
|
||||
class QMarginsF;
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -19,6 +19,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_ENABLE_P0846_SEMANTICS_FOR(get)
|
||||
|
||||
class QDataStream;
|
||||
class QPointF;
|
||||
|
||||
class QPoint
|
||||
|
Loading…
x
Reference in New Issue
Block a user