aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/generator.cpp2
-rw-r--r--sources/shiboken2/generator/shiboken2/headergenerator.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp
index 87758e533..fe03d3489 100644
--- a/sources/shiboken2/generator/generator.cpp
+++ b/sources/shiboken2/generator/generator.cpp
@@ -28,6 +28,7 @@
#include "generator.h"
#include "abstractmetalang.h"
+#include "parser/codemodel.h"
#include "messages.h"
#include "reporthandler.h"
#include "fileout.h"
@@ -911,6 +912,7 @@ 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('_'));
diff --git a/sources/shiboken2/generator/shiboken2/headergenerator.cpp b/sources/shiboken2/generator/shiboken2/headergenerator.cpp
index 8881d71f4..17ebbcde9 100644
--- a/sources/shiboken2/generator/shiboken2/headergenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/headergenerator.cpp
@@ -31,6 +31,7 @@
#include <typedatabase.h>
#include <reporthandler.h>
#include <fileout.h>
+#include "parser/codemodel.h"
#include <algorithm>
@@ -592,8 +593,10 @@ void HeaderGenerator::writeSbkTypeFunction(QTextStream& s, const AbstractMetaCla
void HeaderGenerator::writeSbkTypeFunction(QTextStream &s, const AbstractMetaType *metaType)
{
- s << "template<> inline PyTypeObject* SbkType< ::" << metaType->cppSignature() << " >() "
- << "{ return reinterpret_cast<PyTypeObject*>(" << cpythonTypeNameExt(metaType) << "); }\n";
+ QString signature = metaType->cppSignature();
+ TypeInfo::stripQualifiers(&signature); // for const refs to smart pointers
+ s << "template<> inline PyTypeObject *SbkType< ::" << signature << " >() "
+ << "{ return reinterpret_cast<PyTypeObject *>(" << cpythonTypeNameExt(metaType) << "); }\n";
}
void HeaderGenerator::writeInheritedOverloads(QTextStream& s)