diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguivariant.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index c6462dfed7b..6da0c4d387b 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -52,14 +52,13 @@ QT_BEGIN_NAMESPACE namespace { - -// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class struct QVariantGuiHelper : QMetaTypeModuleHelper { #define QT_IMPL_METATYPEINTERFACE_GUI_TYPES(MetaTypeName, MetaTypeId, RealName) \ QT_METATYPE_INTERFACE_INIT(RealName), - const QtPrivate::QMetaTypeInterface *interfaceForType(int type) const override { + static const QtPrivate::QMetaTypeInterface *interfaceForType(int type) + { switch (type) { QT_FOR_EACH_STATIC_GUI_CLASS(QT_METATYPE_CONVERT_ID_TO_TYPE) default: return nullptr; @@ -67,7 +66,7 @@ struct QVariantGuiHelper : QMetaTypeModuleHelper } #undef QT_IMPL_METATYPEINTERFACE_GUI_TYPES - bool convert(const void *from, int fromTypeId, void *to, int toTypeId) const override + static bool convert(const void *from, int fromTypeId, void *to, int toTypeId) { Q_ASSERT(fromTypeId != toTypeId); @@ -133,14 +132,14 @@ struct QVariantGuiHelper : QMetaTypeModuleHelper return false; } }; - -static constexpr QVariantGuiHelper qVariantGuiHelper; - } // namespace used to hide QVariant handler void qRegisterGuiVariant() { - qMetaTypeGuiHelper = &qVariantGuiHelper; + qMetaTypeGuiHelper = QMetaTypeModuleHelper{ + &QVariantGuiHelper::interfaceForType, + &QVariantGuiHelper::convert, + }; } Q_CONSTRUCTOR_FUNCTION(qRegisterGuiVariant) |