Refactoring.

Code style.
This commit is contained in:
Roman Telezhynskyi 2023-10-04 16:58:56 +03:00
parent ecf93f8d31
commit 5f60af68ca

View File

@ -34,16 +34,16 @@ constexpr qreal PrintDPI = 96.0;
#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) noexcept
Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; } {
return t;
}
// prevent rvalue arguments: // prevent rvalue arguments:
template <typename T> template <typename T> void qAsConst(const T &&) Q_DECL_EQ_DELETE;
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
#endif #endif
#ifndef Q_DISABLE_ASSIGN #ifndef Q_DISABLE_ASSIGN
#define Q_DISABLE_ASSIGN(Class) \ #define Q_DISABLE_ASSIGN(Class) Class &operator=(const Class &) = delete;
Class &operator=(const Class &) = delete;
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
@ -60,11 +60,11 @@ void qAsConst(const T &&) Q_DECL_EQ_DELETE;
Class &operator=(Class &&) = delete; Class &operator=(Class &&) = delete;
#endif #endif
#define SUFFIX_APPEND(x, y) x ## y // NOLINT(cppcoreguidelines-macro-usage) #define SUFFIX_APPEND(x, y) x##y // NOLINT(cppcoreguidelines-macro-usage)
#define HOURS_INT(x) ((x) * 3600000) // NOLINT(cppcoreguidelines-macro-usage) #define HOURS_INT(x) ((x)*3600000) // NOLINT(cppcoreguidelines-macro-usage)
#define MINUTES_INT(x) ((x) * 60000) // NOLINT(cppcoreguidelines-macro-usage) #define MINUTES_INT(x) ((x)*60000) // NOLINT(cppcoreguidelines-macro-usage)
#define SECONDS_INT(x) ((x) * 1000) // NOLINT(cppcoreguidelines-macro-usage) #define SECONDS_INT(x) ((x)*1000) // NOLINT(cppcoreguidelines-macro-usage)
#define MSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) #define MSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage)
#define MICSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) #define MICSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage)
#define NANOSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage) #define NANOSECONDS_INT(x) (x) // NOLINT(cppcoreguidelines-macro-usage)