summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-21 16:41:34 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-26 03:14:52 +0200
commit4b60cea6020c99dabb3b2777e30f0a3924dcd8a7 (patch)
tree6d001f338d546e9cb1a8dc3693358ff2bf8bf486 /src/corelib/global
parentf20edffcc8089fe573e03bd5e092dafc9b0ce568 (diff)
Farewell Q_DISABLE_MOVE
In hindsight, this macro is an API mistake, as it should NEVER be used alone, but always in combination with Q_DISABLE_COPY. But in that case, there's a better macro: Q_DISABLE_COPY_MOVE; hence this API is either bad, or completely redundant. A GitHub search reveals that luckily there's a handful of usages in the wild (of which 0 in Qt/dev and KDE). Hence, I'm going for the kill, and removing it entirely. [ChangeLog][Source-Incompatible Changes][QtGlobal] The Q_DISABLE_MOVE macro has been removed. Code that was using it can be ported to Q_DISABLE_COPY_MOVE instead. Change-Id: I7e346f7e2288f3f5a45315f4f6bfaeb2661f1de5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qglobal.cpp17
-rw-r--r--src/corelib/global/qglobal.h7
2 files changed, 5 insertions, 19 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index b320faa72f..56246783ed 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -651,18 +651,7 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
application would probably crash when you called a member function
of \c{w}.
- \sa Q_DISABLE_COPY_MOVE, Q_DISABLE_MOVE
-*/
-
-/*!
- \macro Q_DISABLE_MOVE(Class)
- \relates QObject
-
- Disables the use of move constructors and move assignment operators
- for the given \a Class.
-
- \sa Q_DISABLE_COPY, Q_DISABLE_COPY_MOVE
- \since 5.13
+ \sa Q_DISABLE_COPY_MOVE
*/
/*!
@@ -671,9 +660,9 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined");
A convenience macro that disables the use of copy constructors, assignment
operators, move constructors and move assignment operators for the given
- \a Class, combining Q_DISABLE_COPY and Q_DISABLE_MOVE.
+ \a Class.
- \sa Q_DISABLE_COPY, Q_DISABLE_MOVE
+ \sa Q_DISABLE_COPY
\since 5.13
*/
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 16bcb14e7d..8bf0e8c6bc 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -491,13 +491,10 @@ constexpr inline Deprecated_t Deprecated = {};
Class(const Class &) = delete;\
Class &operator=(const Class &) = delete;
-#define Q_DISABLE_MOVE(Class) \
- Class(Class &&) = delete; \
- Class &operator=(Class &&) = delete;
-
#define Q_DISABLE_COPY_MOVE(Class) \
Q_DISABLE_COPY(Class) \
- Q_DISABLE_MOVE(Class)
+ Class(Class &&) = delete; \
+ Class &operator=(Class &&) = delete;
/*
Implementing a move assignment operator using an established