diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-03 08:57:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-11 19:01:30 +0000 |
commit | 5b682a6bceec3f43a984a028afe242950a2d82d7 (patch) | |
tree | 1809c7b55ef7e3e592d56f714f90520e5ba4ba7f /sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | |
parent | d23b43816a7ed6a9513b2213a7e633eed2155769 (diff) |
shiboken: Add instantiations to TypeInfo
When streamlining the typeinfo structs in
7f798dfc9fc6e3e9756f06f0fedc821e16f1320a,
the parser was wrongly changed to use TypeInfo::m_arguments
for template instantiations. This field is intented
for function pointer arguments (which the parser does not support).
Add a new TypeInfo::m_instantiations (matching
AbstractMetaType::m_instantiations) for templates, support
it in the type parser and to the toString() method.
This allows to remove the mysterious TypeInfo::instantiationName() method.
Task-number: PYSIDE-672
Change-Id: I705b26d65988ebfb837e8323941076b4fb37d120
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index 340ed846a..5e7afbc09 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1014,7 +1014,7 @@ AbstractMetaClass* AbstractMetaBuilderPrivate::traverseTypeDef(const FileModelIt AbstractMetaClass *metaClass = new AbstractMetaClass; metaClass->setTypeDef(true); metaClass->setTypeEntry(type); - metaClass->setBaseClassNames(QStringList() << typeDef->type().qualifiedName().join(colonColon())); + metaClass->setBaseClassNames(QStringList(typeDef->type().toString())); *metaClass += AbstractMetaAttributes::Public; // Set the default include file name @@ -2358,8 +2358,10 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const TypeInfo &_typ QString name = qualifierList.takeLast(); // 4. Special case QFlags (include instantiation in name) - if (qualifiedName == QLatin1String("QFlags")) + if (qualifiedName == QLatin1String("QFlags")) { qualifiedName = typeInfo.toString(); + typeInfo.clearInstantiations(); + } const TypeEntry *type = 0; // 5. Try to find the type @@ -2417,10 +2419,9 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const TypeInfo &_typ metaType->setConstant(typeInfo.isConstant()); metaType->setOriginalTypeDescription(_typei.toString()); - const auto &templateArguments = typeInfo.arguments(); + const auto &templateArguments = typeInfo.instantiations(); for (int t = 0, size = templateArguments.size(); t < size; ++t) { TypeInfo ti = templateArguments.at(t); - ti.setQualifiedName(ti.instantiationName()); AbstractMetaType *targType = translateType(ti); if (!targType) { delete metaType; @@ -2733,7 +2734,7 @@ bool AbstractMetaBuilderPrivate::inheritTemplate(AbstractMetaClass *subclass, const AbstractMetaClass *templateClass, const TypeInfo &info) { - QVector<TypeInfo> targs = info.arguments(); + QVector<TypeInfo> targs = info.instantiations(); QVector<AbstractMetaType *> templateTypes; if (subclass->isTypeDef()) { @@ -2775,7 +2776,7 @@ bool AbstractMetaBuilderPrivate::inheritTemplate(AbstractMetaClass *subclass, } else { qCWarning(lcShiboken).noquote().nospace() << "Ignoring template parameter " << templateParamName << " from " - << info.instantiationName() << ", because I don't know what it is."; + << info.toString() << ", because I don't know what it is."; } } |