diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-04-01 09:39:11 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-04-07 01:29:24 +0200 |
commit | 9c21347863ce70c216fd1a741db3054745365231 (patch) | |
tree | 310c891a563c91e70cc918e11f2056d91fe5612a /src/corelib/text | |
parent | 6963190581eb49b96c68b0e61304663672f1e42b (diff) |
Rest of QtBase: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN
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 <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/text')
-rw-r--r-- | src/corelib/text/qlocale.cpp | 7 | ||||
-rw-r--r-- | src/corelib/text/qlocale_p.h | 11 |
2 files changed, 14 insertions, 4 deletions
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<Qt::DayOfWeek>, 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 <QtCore/qcalendar.h> -#include <QtCore/QList> // Q_DECLARE_METATYPE(QList<Qt::DayOfWeek>) +#include <QtCore/qcontainerfwd.h> #include "qlocale.h" @@ -544,10 +544,13 @@ static_assert(!ascii_isspace(uchar('\377'))); QT_END_NAMESPACE -Q_DECLARE_METATYPE(QStringView) -Q_DECLARE_METATYPE(QList<Qt::DayOfWeek>) +// ### move to qstringview.h +QT_DECL_METATYPE_EXTERN(QStringView, Q_CORE_EXPORT) +// ### move to qnamespace.h +QT_DECL_METATYPE_EXTERN_TAGGED(QList<Qt::DayOfWeek>, 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 |