diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-05-11 15:17:20 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-05-12 12:33:47 +0000 |
commit | 4f4337fa127682619c98f51052a3b05160a51c4e (patch) | |
tree | da028a0ba20430ebc60c5cc6daa17441ab54feac | |
parent | 7160833687bfa82119dc6f55b0dfc7e16efdd4ec (diff) |
shiboken6: Improve message about missing type entries
List the loaded (dependent) type systems as the reason mostly
is a missing dependent type system.
Change-Id: Iaefd39b3097357402292b2520ae410a7fd6a8911
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
(cherry picked from commit cb651fbc38a639337a870c05c2c895965e176265)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/pyside6/PySide6/QtCore/typesystem_core_common.xml | 2 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/messages.cpp | 6 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typedatabase.cpp | 11 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typedatabase.h | 1 |
4 files changed, 17 insertions, 3 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml index 6349f92f2..11579a866 100644 --- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml +++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml @@ -3338,7 +3338,7 @@ <suppress-warning text="Visibility of function '*' modified in class '*'"/> <suppress-warning text="hiding of function '*' in class '*'"/> <suppress-warning text="Shadowing: *"/> - <suppress-warning text="namespace '*' does not have a type entry"/> + <suppress-warning text="^namespace '.*' does not have a type entry.*$"/> <!-- QCborStreamReader: Suppress warnings about 32/64bit signatures not found depending on qsizetype --> <suppress-warning text="^signature 'readStringChunk\(char.*in 'QCborStreamReader' not found.*$"/> diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp index ab112bf57..2f3faac8e 100644 --- a/sources/shiboken6/ApiExtractor/messages.cpp +++ b/sources/shiboken6/ApiExtractor/messages.cpp @@ -225,7 +225,8 @@ QString msgNoEnumTypeEntry(const EnumModelItem &enumItem, QTextStream str(&result); str << enumItem->sourceLocation(); msgFormatEnumType(str, enumItem, className); - str << " does not have a type entry"; + str << " does not have a type entry (type systems: " + << TypeDatabase::instance()->loadedTypeSystemNames() << ')'; return result; } @@ -249,7 +250,8 @@ QString msgNamespaceNoTypeEntry(const NamespaceModelItem &item, QString result; QTextStream str(&result); str << item->sourceLocation() << "namespace '" << fullName - << "' does not have a type entry"; + << "' does not have a type entry (type systems: " + << TypeDatabase::instance()->loadedTypeSystemNames() << ')'; return result; } diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp index 8f232aee1..966eb05ab 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.cpp +++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp @@ -417,6 +417,17 @@ TypeSystemTypeEntryCPtr TypeDatabase::defaultTypeSystemType() const return d->defaultTypeSystemType(); } +QString TypeDatabase::loadedTypeSystemNames() const +{ + QString result; + for (const auto &entry : d->m_typeSystemEntries) { + if (!result.isEmpty()) + result += u", "_s; + result += entry->name(); + } + return result; +} + TypeSystemTypeEntryCPtr TypeDatabasePrivate::defaultTypeSystemType() const { return m_typeSystemEntries.value(0, nullptr); diff --git a/sources/shiboken6/ApiExtractor/typedatabase.h b/sources/shiboken6/ApiExtractor/typedatabase.h index 45cd1d2db..2d01ac035 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.h +++ b/sources/shiboken6/ApiExtractor/typedatabase.h @@ -98,6 +98,7 @@ public: FunctionTypeEntryPtr findFunctionType(const QString &name) const; TypeSystemTypeEntryCPtr findTypeSystemType(const QString &name) const; TypeSystemTypeEntryCPtr defaultTypeSystemType() const; + QString loadedTypeSystemNames() const; QString defaultPackageName() const; TypeEntryPtr findType(const QString &name) const; |