diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-22 17:32:53 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-22 20:18:09 +0000 |
commit | 956a8c13a836eb4d3b469bf2c9d8cbb1619ddf12 (patch) | |
tree | bfd6fb92ec9c2b7345ad71666bad4cce1512426f /sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | |
parent | 94aa45c4031891aaf084d8efdaa35e09087abf56 (diff) |
shiboken: Improve error message about missing function for modification
The signature is passed through TypeDatabase::normalizedSignature()
which calls QMetaObject::normalizedSignature().
Keep the original signature and output it in the error message.
Change-Id: Ibd1ddd0dee17d828710caf4bf6d674c35776b4c2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index fa9f78ca0..0e96b4c34 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -163,13 +163,18 @@ QSet<QString> AbstractMetaBuilder::qtMetaTypeDeclaredTypeNames() const return d->m_qmetatypeDeclaredTypenames; } -static QString msgNoFunctionForModification(const QString &signature, const QString &className, +static QString msgNoFunctionForModification(const QString &signature, + const QString &originalSignature, + const QString &className, const QStringList &possibleSignatures, const AbstractMetaFunctionList &allFunctions) { QString result; QTextStream str(&result); - str << "signature '" << signature << "' for function modification in '" + str << "signature '" << signature << '\''; + if (!originalSignature.isEmpty() && originalSignature != signature) + str << " (specified as '" << originalSignature << "')"; + str << " for function modification in '" << className << "' not found."; if (possibleSignatures.isEmpty()) { str << " No candidates were found. Member functions: "; @@ -231,7 +236,9 @@ void AbstractMetaBuilderPrivate::checkFunctionModifications() if (!found) { qCWarning(lcShiboken).noquote().nospace() - << msgNoFunctionForModification(signature, clazz->qualifiedCppName(), + << msgNoFunctionForModification(signature, + modification.originalSignature(), + clazz->qualifiedCppName(), possibleSignatures, functions); } } |