From 9c21347863ce70c216fd1a741db3054745365231 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 1 Apr 2022 09:39:11 +0200 Subject: =?UTF-8?q?Rest=20of=20QtBase:=20sweep=20Q=5FDECLARE=5FMETATYPE=20?= =?UTF-8?q?=E2=86=92=20QT=5FDECL=5FMETATYPE=5FEXTERN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's one of our best tools to improve compile times. In some places, we can't do the change, yet, because there's no .cpp file for the header file. Also mark Q_DECLARE_METATYPE macros that are in the wrong place. We shouldn't have Q_D_M markup for public classes in .cpp or _p.h files. Fixes: QTBUG-102206 Change-Id: Iec0a39e4745571b24d07dacc87593321967c10e3 Reviewed-by: Fabian Kosmale Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Qt CI Bot --- src/corelib/text/qlocale.cpp | 7 +++++++ src/corelib/text/qlocale_p.h | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/corelib/text') diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 69249012f5..1f2a0b62e2 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -84,6 +84,13 @@ QT_WARNING_DISABLE_GCC("-Wfree-nonheap-object") // false positive tracking QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QStringView) +QT_IMPL_METATYPE_EXTERN_TAGGED(QList, QList_Qt__DayOfWeek) +#ifndef QT_NO_SYSTEMLOCALE +QT_IMPL_METATYPE_EXTERN_TAGGED(QSystemLocale::CurrencyToStringArgument, + QSystemLocale__CurrencyToStringArgument) +#endif + using namespace Qt::StringLiterals; #ifndef QT_NO_SYSTEMLOCALE diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h index 679bd136e9..87c78bb91a 100644 --- a/src/corelib/text/qlocale_p.h +++ b/src/corelib/text/qlocale_p.h @@ -58,7 +58,7 @@ #include "QtCore/qvariant.h" #include "QtCore/qnumeric.h" #include -#include // Q_DECLARE_METATYPE(QList) +#include #include "qlocale.h" @@ -544,10 +544,13 @@ static_assert(!ascii_isspace(uchar('\377'))); QT_END_NAMESPACE -Q_DECLARE_METATYPE(QStringView) -Q_DECLARE_METATYPE(QList) +// ### move to qstringview.h +QT_DECL_METATYPE_EXTERN(QStringView, Q_CORE_EXPORT) +// ### move to qnamespace.h +QT_DECL_METATYPE_EXTERN_TAGGED(QList, QList_Qt__DayOfWeek, Q_CORE_EXPORT) #ifndef QT_NO_SYSTEMLOCALE -Q_DECLARE_METATYPE(QSystemLocale::CurrencyToStringArgument) +QT_DECL_METATYPE_EXTERN_TAGGED(QSystemLocale::CurrencyToStringArgument, + QSystemLocale__CurrencyToStringArgument, Q_CORE_EXPORT) #endif #endif // QLOCALE_P_H -- cgit v1.2.3