diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-16 13:37:10 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-16 12:59:43 +0000 |
| commit | 498a6b60f0e36f28f7d086f42f4ee4d1ea5a9069 (patch) | |
| tree | e8dcdb4652ae2b4e1f5d7b5a4e2bb770d4cf9ddf | |
| parent | b6eaa63a81654459827851a261ad50829cc511ba (diff) | |
shiboken2: Work around signature problems with smart pointer instantiations
- Drop the module of the instantiations.
- Add a dummy mapping entry, declaring it to be a 1-tuple.
Task-number: PYSIDE-1212
Task-number: PYSIDE-1367
Change-Id: Iddb1feaafbe416ae57d761a33276cb4a1d88e9e3
Reviewed-by: Christian Tismer <tismer@stackless.com>
| -rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.cpp | 3 | ||||
| -rw-r--r-- | sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index 592f69c4c..d20caacf1 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -2489,6 +2489,7 @@ QString AbstractMetaType::formatPythonSignature() const * When we have a primitive with an indirection, we use that '*' * character for later postprocessing, since those indirections * need to be modified into a result tuple. + * Smart pointer instantiations: Drop the package */ QString result; if (m_pattern == AbstractMetaType::NativePointerAsArrayPattern) @@ -2497,7 +2498,7 @@ QString AbstractMetaType::formatPythonSignature() const // NativePointerAsArrayPattern indicates when we have <array> in XML. // if (m_typeEntry->isPrimitive() && isConstant()) // result += QLatin1String("const "); - if (!m_typeEntry->isPrimitive() && !package().isEmpty()) + if (!m_typeEntry->isPrimitive() && !m_typeEntry->isSmartPointer() && !package().isEmpty()) result += package() + QLatin1Char('.'); if (isArray()) { // Build nested array dimensions a[2][3] in correct order diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py index bafea4343..f341458d7 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py @@ -264,6 +264,7 @@ type_map.update({ "qulonglong": int, "QVariant": Variant, "QVector": typing.List, + "QSharedPointer": typing.Tuple, "real": float, "short": int, "signed char": int, |
