diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-12 11:10:07 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-14 12:37:22 +0200 |
commit | b0da5a06e147b02af0bf2d69364e3bfcc04327d5 (patch) | |
tree | 0a85f604d4a72d57a290f224c011ef34356d9e62 | |
parent | 84becad3db953a692eb4c1e49531b1fc5d04812f (diff) |
shiboken2: Find all template classes for added functions
Task-number: PYSIDE-1202
Change-Id: I7039b113ffd43289f96f890ca55cb5b9b4607c92
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index a2e2841df..838b28988 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1976,13 +1976,21 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const AddedFunction: bool isTemplate = false; QStringList templateArgs; if (!type && typeInfo.name.contains(QLatin1Char('<'))) { - const QStringList& parsedType = parseTemplateType(typeInfo.name); + QStringList parsedType = parseTemplateType(typeInfo.name); if (parsedType.isEmpty()) { *errorMessage = QStringLiteral("Template type parsing failed for '%1'").arg(typeInfo.name); return nullptr; } - templateArgs = parsedType.mid(1); - isTemplate = (type = typeDb->findContainerType(parsedType[0])); + const QString name = parsedType.takeFirst(); + templateArgs = parsedType; + type = typeDb->findContainerType(name); + if (!type) { // A template typedef? + if (auto candidate = typeDb->findType(name)) { + if (candidate->type() == TypeEntry::ObjectType || candidate->type() == TypeEntry::BasicValueType) + type = candidate; + } + } + isTemplate = type != nullptr; } if (!type) { |