native interface plumbing: Fix ambiguities with existing classes named TypeInfo

As is the case in Qt for Python, causing:

QtCore/qcoreapplication.h: In member function I* QCoreApplication::nativeInterface() const:
QtCore/qcoreapplication.h:163:5: error: reference to TypeInfo is ambiguous
  163 |     QT_DECLARE_NATIVE_INTERFACE_ACCESSOR

Amends 7feeb7c34b.

Change-Id: I7d363e1d8c0a0f648d12f8040afb9d071356cbb8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Friedemann Kleint 2021-05-14 08:34:21 +02:00
parent 08cd5580df
commit db32369935

View File

@ -104,11 +104,10 @@ namespace QNativeInterface::Private {
I *nativeInterface() const \
{ \
using T = std::decay_t<decltype(*this)>; \
using namespace QNativeInterface::Private; \
static_assert(TypeInfo<I>::template isCompatibleWith<T>, \
static_assert(QNativeInterface::Private::TypeInfo<I>::template isCompatibleWith<T>, \
"T::nativeInterface<I>() requires that native interface I is compatible with T"); \
\
return static_cast<I*>(resolveInterface(this, typeid(I), TypeInfo<I>::revision())); \
return static_cast<I*>(QNativeInterface::Private::resolveInterface(this, typeid(I), QNativeInterface::Private::TypeInfo<I>::revision())); \
}
// Provides a definition for the interface destructor