qmetatype: Remove left-over module association code
Qt 6's metatype does no longer care whether the type is from Core, GUI or a user metatype. Change-Id: I4f41d44a61a9839f58b957219c2404512630587a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
454a9424b7
commit
0af3d57980
@ -100,12 +100,6 @@ QT_BEGIN_NAMESPACE
|
||||
QT_IMPL_METATYPE_EXTERN_TAGGED(QtMetaTypePrivate::QPairVariantInterfaceImpl, QPairVariantInterfaceImpl)
|
||||
|
||||
namespace {
|
||||
struct DefinedTypesFilter {
|
||||
template<typename T>
|
||||
struct Acceptor {
|
||||
static const bool IsAccepted = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && QModulesPrivate::QTypeModuleInfo<T>::IsCore;
|
||||
};
|
||||
};
|
||||
|
||||
struct QMetaTypeCustomRegistry
|
||||
{
|
||||
|
@ -56,67 +56,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QModulesPrivate {
|
||||
enum Names { Core, Gui, Widgets, Unknown, ModulesCount /* ModulesCount has to be at the end */ };
|
||||
|
||||
template <typename T>
|
||||
class QTypeModuleInfo
|
||||
{
|
||||
public:
|
||||
enum Module : bool {
|
||||
IsCore = false,
|
||||
IsWidget = false,
|
||||
IsGui = false,
|
||||
IsUnknown = true
|
||||
};
|
||||
};
|
||||
|
||||
#define QT_ASSIGN_TYPE_TO_MODULE(TYPE, MODULE) \
|
||||
template<> \
|
||||
class QTypeModuleInfo<TYPE > \
|
||||
{ \
|
||||
public: \
|
||||
enum Module : bool { \
|
||||
IsCore = (((MODULE) == (QModulesPrivate::Core))), \
|
||||
IsWidget = (((MODULE) == (QModulesPrivate::Widgets))), \
|
||||
IsGui = (((MODULE) == (QModulesPrivate::Gui))), \
|
||||
IsUnknown = !(IsCore || IsWidget || IsGui) \
|
||||
}; \
|
||||
static inline int module() { return MODULE; } \
|
||||
static_assert((IsUnknown && !(IsCore || IsWidget || IsGui)) \
|
||||
|| (IsCore && !(IsUnknown || IsWidget || IsGui)) \
|
||||
|| (IsWidget && !(IsUnknown || IsCore || IsGui)) \
|
||||
|| (IsGui && !(IsUnknown || IsCore || IsWidget))); \
|
||||
};
|
||||
|
||||
|
||||
#define QT_DECLARE_CORE_MODULE_TYPES_ITER(TypeName, TypeId, Name) \
|
||||
QT_ASSIGN_TYPE_TO_MODULE(Name, QModulesPrivate::Core)
|
||||
#define QT_DECLARE_GUI_MODULE_TYPES_ITER(TypeName, TypeId, Name) \
|
||||
QT_ASSIGN_TYPE_TO_MODULE(Name, QModulesPrivate::Gui)
|
||||
#define QT_DECLARE_WIDGETS_MODULE_TYPES_ITER(TypeName, TypeId, Name) \
|
||||
QT_ASSIGN_TYPE_TO_MODULE(Name, QModulesPrivate::Widgets)
|
||||
|
||||
QT_WARNING_PUSH
|
||||
#if defined(Q_CC_CLANG) && Q_CC_CLANG >= 900
|
||||
QT_WARNING_DISABLE_CLANG("-Wconstant-logical-operand")
|
||||
#endif
|
||||
|
||||
QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(QT_DECLARE_CORE_MODULE_TYPES_ITER)
|
||||
QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(QT_DECLARE_CORE_MODULE_TYPES_ITER)
|
||||
QT_FOR_EACH_STATIC_CORE_CLASS(QT_DECLARE_CORE_MODULE_TYPES_ITER)
|
||||
QT_FOR_EACH_STATIC_CORE_POINTER(QT_DECLARE_CORE_MODULE_TYPES_ITER)
|
||||
QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_DECLARE_CORE_MODULE_TYPES_ITER)
|
||||
QT_FOR_EACH_STATIC_GUI_CLASS(QT_DECLARE_GUI_MODULE_TYPES_ITER)
|
||||
QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_DECLARE_WIDGETS_MODULE_TYPES_ITER)
|
||||
|
||||
QT_WARNING_POP
|
||||
} // namespace QModulesPrivate
|
||||
|
||||
#undef QT_DECLARE_CORE_MODULE_TYPES_ITER
|
||||
#undef QT_DECLARE_GUI_MODULE_TYPES_ITER
|
||||
#undef QT_DECLARE_WIDGETS_MODULE_TYPES_ITER
|
||||
|
||||
#define QMETATYPE_CONVERTER(To, From, assign_and_return) \
|
||||
case makePair(QMetaType::To, QMetaType::From): \
|
||||
if (onlyCheck) \
|
||||
|
@ -92,12 +92,6 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace {
|
||||
struct GuiTypesFilter {
|
||||
template<typename T>
|
||||
struct Acceptor {
|
||||
static const bool IsAccepted = QModulesPrivate::QTypeModuleInfo<T>::IsGui && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable;
|
||||
};
|
||||
};
|
||||
|
||||
static const struct : QMetaTypeModuleHelper
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user