summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2020-11-27 11:18:00 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2020-11-30 17:16:21 +0100
commit0440614af0bb08e373d8e3e40f90b6412c043d14 (patch)
tree28eb691637384b1c8ea9bbbc1a9675fb0d7d977b /src/corelib/global
parent5e84023344bfe8987c3ce5edf57f30261d677d2c (diff)
Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qlogging.cpp2
-rw-r--r--src/corelib/global/qnamespace.h2
-rw-r--r--src/corelib/global/qtypeinfo.h6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 52a565aa45..04468d7aac 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1096,7 +1096,7 @@ struct QMessagePattern
static QBasicMutex mutex;
};
#ifdef QLOGGING_HAVE_BACKTRACE
-Q_DECLARE_TYPEINFO(QMessagePattern::BacktraceParams, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QMessagePattern::BacktraceParams, Q_RELOCATABLE_TYPE);
#endif
QBasicMutex QMessagePattern::mutex;
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index a42dc726bc..4bc0186210 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1919,7 +1919,7 @@ public:
}
};
-Q_DECLARE_TYPEINFO(QKeyCombination, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QKeyCombination, Q_RELOCATABLE_TYPE);
constexpr QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key) noexcept
{
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index f3382ea17e..e5914414f2 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -188,7 +188,7 @@ Q_DECLARE_TYPEINFO_BODY(QFlags<T>, Q_PRIMITIVE_TYPE);
namespace as Qt for this to work.
If the type was already released without Q_DECLARE_SHARED applied,
- _and_ without an explicit Q_DECLARE_TYPEINFO(type, Q_MOVABLE_TYPE),
+ _and_ without an explicit Q_DECLARE_TYPEINFO(type, Q_RELOCATABLE_TYPE),
then use Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(type) to mark the
type shared (incl. swap()), without marking it movable (which
would change the memory layout of QList, a BiC change.
@@ -199,9 +199,9 @@ Q_DECLARE_TYPEINFO(TYPE, FLAGS); \
inline void swap(TYPE &value1, TYPE &value2) \
noexcept(noexcept(value1.swap(value2))) \
{ value1.swap(value2); }
-#define Q_DECLARE_SHARED(TYPE) Q_DECLARE_SHARED_IMPL(TYPE, Q_MOVABLE_TYPE)
+#define Q_DECLARE_SHARED(TYPE) Q_DECLARE_SHARED_IMPL(TYPE, Q_RELOCATABLE_TYPE)
#define Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(TYPE) \
- Q_DECLARE_SHARED_IMPL(TYPE, Q_MOVABLE_TYPE)
+ Q_DECLARE_SHARED_IMPL(TYPE, Q_RELOCATABLE_TYPE)
namespace QTypeTraits
{