diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-08-31 09:53:23 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-31 11:10:26 +0000 |
commit | 50676dae43c0e2f1fd4a2eedeb1a120054d8f3be (patch) | |
tree | c5c847d62fa3324daa0573bc74964e984c89753e | |
parent | 03ae79b1038b7dc49cd8c4ea5675f4f24b8dd35f (diff) |
shiboken6: Improve message about not being able to resolve typedefs
Change-Id: I9605d7992dfd7506c1d6e75c2719d77cfeffe449
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
(cherry picked from commit c2ad08a6d2e5b9bb743194ce46643d113dc895ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/shiboken6/ApiExtractor/messages.cpp | 9 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/messages.h | 1 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typedatabase.cpp | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp index 01fe08819..d1eb0e44a 100644 --- a/sources/shiboken6/ApiExtractor/messages.cpp +++ b/sources/shiboken6/ApiExtractor/messages.cpp @@ -867,6 +867,15 @@ QString msgCannotFindSnippet(const QString &file, const QString &snippetLabel) return result; } +QString msgUnableToResolveTypedef(const QString &sourceType, const QString &sourceName) +{ + QString result; + QTextStream(&result) << "Unable to resolve typedef \"" << sourceType + << "\": Could not find a value, container, object or smart pointer type named \"" + << sourceName << "\"."; + return result; +} + // cppgenerator.cpp QString msgPureVirtualFunctionRemoved(const AbstractMetaFunction *f) diff --git a/sources/shiboken6/ApiExtractor/messages.h b/sources/shiboken6/ApiExtractor/messages.h index 6d12195d1..a0bd94c55 100644 --- a/sources/shiboken6/ApiExtractor/messages.h +++ b/sources/shiboken6/ApiExtractor/messages.h @@ -208,6 +208,7 @@ QString msgIncorrectlyNestedName(const QString &name); QString msgCannotFindView(const QString &viewedName, const QString &name); QString msgCannotFindSnippet(const QString &file, const QString &snippetLabel); +QString msgUnableToResolveTypedef(const QString &sourceType, const QString &sourceName); QString msgCyclicDependency(const QString &funcName, const QString &graphName, const AbstractMetaFunctionCList &cyclic, diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp index e96900dd1..3f02820c7 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.cpp +++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp @@ -626,8 +626,7 @@ TypeEntryPtr TypeDatabasePrivate::resolveTypeDefEntry(const TypedefEntryPtr &typ } if (!source) { if (errorMessage) - *errorMessage = u"Unable to resolve typedef \""_s - + typedefEntry->sourceType() + u'"'; + *errorMessage = msgUnableToResolveTypedef(typedefEntry->sourceType(), sourceName); return nullptr; } |