Function qAsConst() was introduced in Qt 5.7.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-03-19 09:57:43 +02:00
parent c5c65034bf
commit edccf05a62

View File

@ -35,7 +35,7 @@
#define PRINTDPI 96.0 #define PRINTDPI 96.0
extern const qreal PrintDPI; extern const qreal PrintDPI;
#if QT_VERSION <= QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
// this adds const to non-const objects (like std::as_const) // this adds const to non-const objects (like std::as_const)
template <typename T> template <typename T>
Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }