1 /************************************************************************ 2 ** 3 ** @file defglobal.h 4 ** @author Roman Telezhynskyi <dismine(at)gmail.com> 5 ** @date 13 11, 2017 6 ** 7 ** @brief 8 ** @copyright 9 ** This source code is part of the Valentina project, a pattern making 10 ** program, whose allow create and modeling patterns of clothing. 11 ** Copyright (C) 2017 Valentina project 12 ** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved. 13 ** 14 ** Valentina is free software: you can redistribute it and/or modify 15 ** it under the terms of the GNU General Public License as published by 16 ** the Free Software Foundation, either version 3 of the License, or 17 ** (at your option) any later version. 18 ** 19 ** Valentina is distributed in the hope that it will be useful, 20 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 21 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 ** GNU General Public License for more details. 23 ** 24 ** You should have received a copy of the GNU General Public License 25 ** along with Valentina. If not, see <http://www.gnu.org/licenses/>. 26 ** 27 *************************************************************************/ 28 #ifndef DEFGLOBAL_H 29 #define DEFGLOBAL_H 30 31 #include <QtGlobal> 32 33 #include "backport/qoverload.h" 34 35 constexpr qreal PrintDPI = 96.0; 36 37 #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) 38 // this adds const to non-const objects (like std::as_const) 39 template <typename T> qAsConst(T & t)40Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } 41 // prevent rvalue arguments: 42 template <typename T> 43 void qAsConst(const T &&) Q_DECL_EQ_DELETE; 44 #endif 45 46 #ifndef Q_DISABLE_ASSIGN 47 #define Q_DISABLE_ASSIGN(Class) \ 48 Class &operator=(const Class &) Q_DECL_EQ_DELETE; 49 #endif 50 51 #endif // DEFGLOBAL_H 52