Fix build with Qt 5.6.
This commit is contained in:
parent
7a3e37c19a
commit
56cdd08e71
|
@ -39,7 +39,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
#include "../vmisc/vdatastreamenum.h"
|
|
||||||
#include "../ifc/exception/vexception.h"
|
#include "../ifc/exception/vexception.h"
|
||||||
|
|
||||||
const QByteArray VRawLayout::fileHeaderByteArray = QByteArray("RLD!...");
|
const QByteArray VRawLayout::fileHeaderByteArray = QByteArray("RLD!...");
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
#include "../ifc/xml/vabstractpattern.h"
|
#include "../ifc/xml/vabstractpattern.h"
|
||||||
#include "../vpatterndb/floatItemData/vpiecelabeldata.h"
|
#include "../vpatterndb/floatItemData/vpiecelabeldata.h"
|
||||||
#include "../vmisc/vabstractvalapplication.h"
|
#include "../vmisc/vabstractvalapplication.h"
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
|
||||||
|
# include "../vmisc/vdatastreamenum.h"
|
||||||
|
#endif
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
#include "../vpatterndb/calculator.h"
|
#include "../vpatterndb/calculator.h"
|
||||||
#include "../vpatterndb/variables/vmeasurement.h"
|
#include "../vpatterndb/variables/vmeasurement.h"
|
||||||
|
|
|
@ -39,19 +39,16 @@
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<std::is_enum<T>::value, QDataStream &>::type&
|
auto operator<<(QDataStream &s, const T &t) -> typename std::enable_if<std::is_enum<T>::value, QDataStream &>::type&
|
||||||
operator<<(QDataStream &s, const T &t)
|
|
||||||
{
|
{
|
||||||
return s << static_cast<typename std::underlying_type<T>::type>(t);
|
return s << static_cast<typename std::underlying_type<T>::type>(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<std::is_enum<T>::value, QDataStream &>::type&
|
auto operator>>(QDataStream &s, T &t) -> typename std::enable_if<std::is_enum<T>::value, QDataStream &>::type&
|
||||||
operator>>(QDataStream &s, T &t)
|
|
||||||
{
|
{
|
||||||
return s >> reinterpret_cast<typename std::underlying_type<T>::type &>(t);
|
return s >> reinterpret_cast<typename std::underlying_type<T>::type &>(t); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
|
||||||
template <typename Enum>
|
template <typename Enum>
|
||||||
|
@ -68,6 +65,7 @@ inline QDataStream &operator>>(QDataStream &s, QFlags<Enum> &e)
|
||||||
e = static_cast<QFlags<Enum>>(v);
|
e = static_cast<QFlags<Enum>>(v);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
|
||||||
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
|
|
||||||
#endif // DATASTREAM_ENUM_H
|
#endif // DATASTREAM_ENUM_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user