summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetsvariant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwidgetsvariant.cpp')
-rw-r--r--src/widgets/kernel/qwidgetsvariant.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp
index 17a19aa780d..c843927d366 100644
--- a/src/widgets/kernel/qwidgetsvariant.cpp
+++ b/src/widgets/kernel/qwidgetsvariant.cpp
@@ -11,18 +11,16 @@
QT_BEGIN_NAMESPACE
namespace {
-
-// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
-static constexpr struct : QMetaTypeModuleHelper
+struct QVariantWidgetsHelper : QMetaTypeModuleHelper
{
- const QtPrivate::QMetaTypeInterface *interfaceForType(int type) const override {
+ static const QtPrivate::QMetaTypeInterface *interfaceForType(int type)
+ {
switch (type) {
QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_METATYPE_CONVERT_ID_TO_TYPE)
default: return nullptr;
}
}
-} qVariantWidgetsHelper;
-
+};
#undef QT_IMPL_METATYPEINTERFACE_WIDGETS_TYPES
@@ -30,7 +28,9 @@ static constexpr struct : QMetaTypeModuleHelper
void qRegisterWidgetsVariant()
{
- qMetaTypeWidgetsHelper = &qVariantWidgetsHelper;
+ qMetaTypeWidgetsHelper = QMetaTypeModuleHelper{
+ &QVariantWidgetsHelper::interfaceForType,
+ };
}
Q_CONSTRUCTOR_FUNCTION(qRegisterWidgetsVariant)