diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-06 12:51:24 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-06 16:12:35 +0200 |
commit | fd126b28e1d9b02ea16c813bc392461bdb05bd1d (patch) | |
tree | 63066d241027f67dcf58132dad4d70226af7a2a3 /sources/shiboken2/ApiExtractor/parser/codemodel.cpp | |
parent | f7f12ba7f277d4c074382b5434123dc66b8791b8 (diff) |
shiboken: Fix generation of init functions and types for const-refs of smart pointers
Add a convenience to strip all qualifiers and use that.
This at least fixes the naming (for example, getInitFunctionName
returning "const_QSharedPointer_QSize___&"), the init function for the
type itself is missing, though.
Task-number: PYSIDE-1016
Change-Id: Id61b3c879199fc061e2846007951e3e9c82b85c4
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/parser/codemodel.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp index eb0f44689..7bb7e0a83 100644 --- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp +++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp @@ -353,6 +353,17 @@ bool TypeInfo::stripLeadingQualifier(const QString &qualifier, QString *s) return true; } +// Strip all const/volatile/*/& +void TypeInfo::stripQualifiers(QString *s) +{ + stripLeadingConst(s); + stripLeadingVolatile(s); + while (s->endsWith(QLatin1Char('&')) || s->endsWith(QLatin1Char('*')) + || s->endsWith(QLatin1Char(' '))) { + s->chop(1); + } +} + // Helper functionality to simplify a raw standard type as returned by // clang_getCanonicalType() for g++ standard containers from // "std::__cxx11::list<int, std::allocator<int> >" or |