diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index b42e5998fc..cd0a83ae80 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -276,13 +276,25 @@ Q_DECLARE_TYPEINFO(double, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE); #endif + #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) -// We can't do it now because it would break BC on QList<char32_t> +// ### Qt 6: remove the other branch +// This was required so that QList<T> for these types allocates out of the array storage +# ifdef Q_COMPILER_UNICODE_STRINGS Q_DECLARE_TYPEINFO(char16_t, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(char32_t, Q_PRIMITIVE_TYPE); +# endif # if !defined(Q_CC_MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) Q_DECLARE_TYPEINFO(wchar_t, Q_PRIMITIVE_TYPE); # endif +#else +# ifdef Q_COMPILER_UNICODE_STRINGS +Q_DECLARE_TYPEINFO(char16_t, Q_RELOCATABLE_TYPE); +Q_DECLARE_TYPEINFO(char32_t, Q_RELOCATABLE_TYPE); +# endif +# if !defined(Q_CC_MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) +Q_DECLARE_TYPEINFO(wchar_t, Q_RELOCATABLE_TYPE); +# endif #endif // Qt 6 QT_END_NAMESPACE |