From 8160ac2e10f99066ee801637ad1f0fd0cc7c585c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Mar 2021 10:49:36 +0100 Subject: shiboken6: Fix AbstractMetaClass::fullName() for nested classes Use the fully qualified name. Task-number: PYSIDE-1520 Change-Id: I58bf8f2d3e1b95947769b725746f560947d25f06 Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 3521dfcee8a800927aaf024ab2b64b1402e8256b) --- sources/shiboken2/ApiExtractor/abstractmetalang.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.cpp') diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index bac700912..97bfd8f1b 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -2164,6 +2164,11 @@ void AbstractMetaClass::getFunctionsFromInvisibleNamespacesToBeGenerated(Abstrac } } +QString AbstractMetaClass::fullName() const +{ + return package() + QLatin1Char('.') + m_typeEntry->targetLangName(); +} + static void addExtraIncludeForType(AbstractMetaClass *metaClass, const AbstractMetaType *type) { if (!type) @@ -2735,4 +2740,3 @@ QString AbstractMetaEnum::package() const { return m_typeEntry->targetLangPackage(); } - -- cgit v1.2.3 From 49c115b88d9175c7c160e81d11450c6d42029b5f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Apr 2021 14:41:40 +0200 Subject: shiboken6: Prevent crashes when registering static fields Registering static fields invokes converters, which can cause crashes for uninitialized types (see also 2ac1870053370e017567ae53e62cd1155a01c88f). To solve this problem, move the static field initialization to the end of the module initialization function to ensure all converters are available. Fixes: PYSIDE-1529 Change-Id: If40c6faf049077db8afcdee2069f4441c21beaa4 Reviewed-by: Renato Araujo Oliveira Filho Reviewed-by: Christian Tismer (cherry picked from commit af1bdd8447771728321984f87447187f0284db6b) Reviewed-by: Qt CI Bot --- sources/shiboken2/ApiExtractor/abstractmetalang.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.cpp') diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index 97bfd8f1b..06d5af14c 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -2116,6 +2116,12 @@ AbstractMetaField *AbstractMetaClass::findField(const QString &name) const return AbstractMetaField::find(m_fields, name); } +bool AbstractMetaClass::hasStaticFields() const +{ + return std::any_of(m_fields.cbegin(), m_fields.cend(), + [](const AbstractMetaField *f) { return f->isStatic(); }); +} + AbstractMetaEnum *AbstractMetaClass::findEnum(const QString &enumName) { if (AbstractMetaEnum *e = findByName(m_enums, enumName)) -- cgit v1.2.3