From 486b7a8f8a4d984d2783a5717ef8ec5dc9b1666d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 20 May 2021 11:36:39 +0200 Subject: Type erase native interfaces via string instead of typeid The latter forces users to build with RTTI enabled, as the typeid use is in our public headers. Surprisingly this is also the case even without instantiating the relevant template. Change-Id: Icd18a2b85b250e0b77960797e5c43b7eaf9bd891 Reviewed-by: Friedemann Kleint Reviewed-by: Fabian Kosmale --- src/gui/kernel/qguiapplication.cpp | 4 ++-- src/gui/kernel/qkeymapper.cpp | 4 ++-- src/gui/kernel/qoffscreensurface.cpp | 4 ++-- src/gui/kernel/qopenglcontext.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 1905361c5e..e8308d3b8c 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -4197,7 +4197,7 @@ QInputDeviceManager *QGuiApplicationPrivate::inputDeviceManager() } template <> -Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QGuiApplication *that, const std::type_info &type, int revision) +Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QGuiApplication *that, const char *name, int revision) { using namespace QNativeInterface::Private; @@ -4208,7 +4208,7 @@ Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(cons QT_NATIVE_INTERFACE_RETURN_IF(QWindowsApplication, platformIntegration); #endif - return resolveInterface(that, type, revision); + return resolveInterface(that, name, revision); } #include "moc_qguiapplication.cpp" diff --git a/src/gui/kernel/qkeymapper.cpp b/src/gui/kernel/qkeymapper.cpp index 3781330073..e3d39f80dc 100644 --- a/src/gui/kernel/qkeymapper.cpp +++ b/src/gui/kernel/qkeymapper.cpp @@ -136,9 +136,9 @@ QList QKeyMapperPrivate::possibleKeys(QKeyEvent *e) } template <> -Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QKeyMapper *that, const std::type_info &type, int revision) +Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QKeyMapper *that, const char *name, int revision) { - Q_UNUSED(that); Q_UNUSED(type); Q_UNUSED(revision); + Q_UNUSED(that); Q_UNUSED(name); Q_UNUSED(revision); using namespace QNativeInterface::Private; #if QT_CONFIG(evdev) diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp index 53c60b278e..7cb8050504 100644 --- a/src/gui/kernel/qoffscreensurface.cpp +++ b/src/gui/kernel/qoffscreensurface.cpp @@ -372,9 +372,9 @@ QPlatformSurface *QOffscreenSurface::surfaceHandle() const using namespace QNativeInterface; template <> -Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QOffscreenSurface *that, const std::type_info &type, int revision) +Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QOffscreenSurface *that, const char *name, int revision) { - Q_UNUSED(that); Q_UNUSED(type); Q_UNUSED(revision); + Q_UNUSED(that); Q_UNUSED(name); Q_UNUSED(revision); auto *surfacePrivate = QOffscreenSurfacePrivate::get(const_cast(that)); Q_UNUSED(surfacePrivate); diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 4a423e7ed5..8a9cd2b85f 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -1312,9 +1312,9 @@ QDebug operator<<(QDebug debug, const QOpenGLContextGroup *cg) using namespace QNativeInterface; template <> -Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QOpenGLContext *that, const std::type_info &type, int revision) +Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QOpenGLContext *that, const char *name, int revision) { - Q_UNUSED(that); Q_UNUSED(type); Q_UNUSED(revision); + Q_UNUSED(that); Q_UNUSED(name); Q_UNUSED(revision); auto *platformContext = that->handle(); Q_UNUSED(platformContext); -- cgit v1.2.3