Introduce new macro Q_DISABLE_ASSIGN_MOVE.

This commit is contained in:
Roman Telezhynskyi 2022-10-08 15:22:17 +03:00
parent 05d064af1e
commit 4a89a0892f
4 changed files with 36 additions and 7 deletions

View file

@ -91,6 +91,12 @@ Q_DISABLE_COPY(Class) \
Q_DISABLE_MOVE(Class) Q_DISABLE_MOVE(Class)
#endif #endif
#ifndef Q_DISABLE_ASSIGN_MOVE
#define Q_DISABLE_ASSIGN_MOVE(Class) \
Q_DISABLE_ASSIGN(Class) \
Q_DISABLE_MOVE(Class)
#endif
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wattributes") QT_WARNING_DISABLE_GCC("-Wattributes")

View file

@ -91,6 +91,12 @@ Q_DISABLE_COPY(Class) \
Q_DISABLE_MOVE(Class) Q_DISABLE_MOVE(Class)
#endif #endif
#ifndef Q_DISABLE_ASSIGN_MOVE
#define Q_DISABLE_ASSIGN_MOVE(Class) \
Q_DISABLE_ASSIGN(Class) \
Q_DISABLE_MOVE(Class)
#endif
typedef signed char dint8; /* 8 bit signed */ typedef signed char dint8; /* 8 bit signed */
typedef signed short dint16; /* 16 bit signed */ typedef signed short dint16; /* 16 bit signed */
typedef signed int dint32; /* 32 bit signed */ typedef signed int dint32; /* 32 bit signed */

View file

@ -43,7 +43,7 @@ void qAsConst(const T &&) Q_DECL_EQ_DELETE;
#ifndef Q_DISABLE_ASSIGN #ifndef Q_DISABLE_ASSIGN
#define Q_DISABLE_ASSIGN(Class) \ #define Q_DISABLE_ASSIGN(Class) \
Class &operator=(const Class &) Q_DECL_EQ_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)
@ -55,6 +55,12 @@ void qAsConst(const T &&) Q_DECL_EQ_DELETE;
Q_DISABLE_MOVE(Class) Q_DISABLE_MOVE(Class)
#endif #endif
#ifndef Q_DISABLE_ASSIGN_MOVE
#define Q_DISABLE_ASSIGN_MOVE(Class) \
Q_DISABLE_ASSIGN(Class) \
Q_DISABLE_MOVE(Class)
#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)

View file

@ -29,6 +29,11 @@
# define VPROPERTYEXPLORERSHARED_EXPORT Q_DECL_IMPORT # define VPROPERTYEXPLORERSHARED_EXPORT Q_DECL_IMPORT
#endif #endif
#ifndef Q_DISABLE_ASSIGN
#define Q_DISABLE_ASSIGN(Class) \
Class &operator=(const Class &) = delete;
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#define Q_DISABLE_MOVE(Class) \ #define Q_DISABLE_MOVE(Class) \
Class(Class &&) = delete; \ Class(Class &&) = delete; \
@ -38,4 +43,10 @@ Q_DISABLE_COPY(Class) \
Q_DISABLE_MOVE(Class) Q_DISABLE_MOVE(Class)
#endif #endif
#ifndef Q_DISABLE_ASSIGN_MOVE
#define Q_DISABLE_ASSIGN_MOVE(Class) \
Q_DISABLE_ASSIGN(Class) \
Q_DISABLE_MOVE(Class)
#endif
#endif // VPROPERTYEXPLORER_GLOBAL_H #endif // VPROPERTYEXPLORER_GLOBAL_H