aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/generator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/generator/generator.cpp')
-rw-r--r--sources/shiboken2/generator/generator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp
index fe03d3489..46ad90724 100644
--- a/sources/shiboken2/generator/generator.cpp
+++ b/sources/shiboken2/generator/generator.cpp
@@ -244,6 +244,13 @@ void Generator::addInstantiatedContainersAndSmartPointers(const AbstractMetaType
// Is smart pointer.
if (!m_d->instantiatedSmartPointerNames.contains(typeName)) {
m_d->instantiatedSmartPointerNames.append(typeName);
+ if (type->isConstant() || type->referenceType() != NoReference) {
+ // Strip a "const QSharedPtr<Foo> &" or similar to "QSharedPtr<Foo>" (PYSIDE-1016)
+ auto fixedType = type->copy();
+ fixedType->setReferenceType(NoReference);
+ fixedType->setConstant(false);
+ type = fixedType;
+ }
m_d->instantiatedSmartPointers.append(type);
}
}
@@ -912,7 +919,6 @@ QString getClassTargetFullName(const AbstractMetaType *metaType, bool includePac
QString getFilteredCppSignatureString(QString signature)
{
- TypeInfo::stripQualifiers(&signature); // for const refs to smart pointers
signature.replace(QLatin1String("::"), QLatin1String("_"));
signature.replace(QLatin1Char('<'), QLatin1Char('_'));
signature.replace(QLatin1Char('>'), QLatin1Char('_'));