Export an extern template for QMetaTypeForType for builtin types
That way not every translation unit generates the QMetaTypeInterface for the builtin types Change-Id: Id703c14532646a58f4088e8f3914564ce35e398e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
4dbac23e53
commit
3c0cd7566c
@ -1755,4 +1755,17 @@ const bool VectorBoolElements::true_element = true;
|
|||||||
const bool VectorBoolElements::false_element = false;
|
const bool VectorBoolElements::false_element = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace QtPrivate {
|
||||||
|
#ifndef QT_BOOTSTRAPPED
|
||||||
|
// Explicit instantiation definition
|
||||||
|
#define QT_METATYPE_DECLARE_TEMPLATE_ITER(TypeName, Id, Name) template class QMetaTypeForType<Name>;
|
||||||
|
QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(QT_METATYPE_DECLARE_TEMPLATE_ITER)
|
||||||
|
QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(QT_METATYPE_DECLARE_TEMPLATE_ITER)
|
||||||
|
QT_FOR_EACH_STATIC_CORE_CLASS(QT_METATYPE_DECLARE_TEMPLATE_ITER)
|
||||||
|
QT_FOR_EACH_STATIC_CORE_POINTER(QT_METATYPE_DECLARE_TEMPLATE_ITER)
|
||||||
|
QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_METATYPE_DECLARE_TEMPLATE_ITER)
|
||||||
|
#undef QT_METATYPE_DECLARE_TEMPLATE_ITER
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -2723,6 +2723,24 @@ QMetaTypeInterface QMetaTypeForType<T>::metaType = {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr const decltype(typenameHelper<T>()) QMetaTypeForType<T>::name = typenameHelper<T>();
|
constexpr const decltype(typenameHelper<T>()) QMetaTypeForType<T>::name = typenameHelper<T>();
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class QMetaTypeForType<void>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef QT_BOOTSTRAPPED
|
||||||
|
#define QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER(TypeName, Id, Name) \
|
||||||
|
extern template class Q_CORE_EXPORT QMetaTypeForType<Name>;
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_GCC("-Wattributes") // false positive because of QMetaTypeForType<void>
|
||||||
|
QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER)
|
||||||
|
QT_WARNING_POP
|
||||||
|
QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER)
|
||||||
|
QT_FOR_EACH_STATIC_CORE_CLASS(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER)
|
||||||
|
QT_FOR_EACH_STATIC_CORE_POINTER(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER)
|
||||||
|
QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER)
|
||||||
|
#undef QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr QMetaTypeInterface *qMetaTypeIntefaceForType()
|
constexpr QMetaTypeInterface *qMetaTypeIntefaceForType()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user