From 8d3ed516a063b365459ce62b8b1b62ed2ad373cb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 21 Jul 2021 11:28:33 +0200 Subject: shiboken6: Refactor AbstractMetaClass:inheritsFrom() Reimplement AbstractMetaClass::inheritsFrom() to go through the list of base classes and the template base class. Add an overload taking a name and use that in some cases. Change-Id: I736fd64bba3365ee9f2ee586844166ed64002706 Reviewed-by: Qt CI Bot Reviewed-by: Christian Tismer --- sources/shiboken6/generator/shiboken/cppgenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp') diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index 51c6d051d..d49b6971a 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -4281,8 +4281,8 @@ void CppGenerator::writeClassDefinition(TextStream &s, bool onlyPrivCtor = !metaClass->hasNonPrivateConstructor(); - const AbstractMetaClass *qCoreApp = AbstractMetaClass::findClass(api().classes(), QLatin1String("QCoreApplication")); - const bool isQApp = qCoreApp != Q_NULLPTR && metaClass->inheritsFrom(qCoreApp); + const bool isQApp = usePySideExtensions() + && metaClass->inheritsFrom(u"QCoreApplication"_qs); tp_flags = QLatin1String("Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES"); if (metaClass->isNamespace() || metaClass->hasPrivateDestructor()) { -- cgit v1.2.3