DRY QT_FOR_EACH_STATIC_CORE_TEMPLATE()

Use the same technique used elsewhere in qmetatype.h to deal with
missing features: define a new macro to either contain the types
controlled by the feature or be empty, and then call that macro from
the larger-scale one.

DRYs the list of types to not repeat QByteArrayList and QStringList.

Amends cdbc76360ae4c12b25923a7cb392355a6485fc70.

Change-Id: I767452aa33c1a2404315a0c3cd02f7102b9d6653
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fbc80ee163f16baafcc236b533ea7ccc3376fa2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-08-28 13:32:44 +02:00 committed by Qt Cherry-pick Bot
parent a9e464119a
commit 6dfb013b62

View File

@ -136,19 +136,20 @@ inline constexpr int qMetaTypeId();
F(QObjectStar, 39, QObject*)
#ifndef QT_NO_VARIANT
# define QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
# define QT_FOR_EACH_STATIC_CORE_QVARIANT_TEMPLATE(F) \
F(QVariantMap, 8, QVariantMap) \
F(QVariantList, 9, QVariantList) \
F(QVariantHash, 28, QVariantHash) \
F(QVariantPair, 58, QVariantPair) \
F(QByteArrayList, 49, QByteArrayList) \
F(QStringList, 11, QStringList) \
/**/
#else
# define QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
# define QT_FOR_EACH_STATIC_CORE_QVARIANT_TEMPLATE(F)
#endif // QT_NO_VARIANT
#define QT_FOR_EACH_STATIC_CORE_TEMPLATE(F) \
QT_FOR_EACH_STATIC_CORE_QVARIANT_TEMPLATE(F) \
F(QByteArrayList, 49, QByteArrayList) \
F(QStringList, 11, QStringList)
#endif
#if QT_CONFIG(shortcut)
#define QT_FOR_EACH_STATIC_KEYSEQUENCE_CLASS(F)\