From 3e63a58a96bc9d7fc6004f3a8eacc062bae953f9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 5 Jul 2015 22:29:55 +0200 Subject: Mark QHash/QMap as relocatable and movable-come-Qt 6 They were forgotten from the movable containers for Qt 5.0. Make sure we don't forget for 6.0, either. Until then, mark with new Q_RELOCATABLE_TYPE. Change-Id: I279a96c02a718a1432040303bb0d001739f59a17 Reviewed-by: Thiago Macieira --- src/corelib/global/qtypeinfo.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 2b4f6ebab4..1200c3b5a5 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -194,6 +194,32 @@ Q_DECLARE_MOVABLE_CONTAINER(QSet); #undef Q_DECLARE_MOVABLE_CONTAINER +/* These cannot be movable before ### Qt 6, for BC reasons */ +#define Q_DECLARE_MOVABLE_CONTAINER(CONTAINER) \ +template class CONTAINER; \ +template \ +class QTypeInfo< CONTAINER > \ +{ \ +public: \ + enum { \ + isPointer = false, \ + isIntegral = false, \ + isComplex = true, \ + isStatic = (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)), \ + isRelocatable = true, \ + isLarge = (sizeof(CONTAINER) > sizeof(void*)), \ + isDummy = false, \ + sizeOf = sizeof(CONTAINER) \ + }; \ +} + +Q_DECLARE_MOVABLE_CONTAINER(QMap); +Q_DECLARE_MOVABLE_CONTAINER(QMultiMap); +Q_DECLARE_MOVABLE_CONTAINER(QHash); +Q_DECLARE_MOVABLE_CONTAINER(QMultiHash); + +#undef Q_DECLARE_MOVABLE_CONTAINER + /* Specialize a specific type with: -- cgit v1.2.3