diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-06-14 14:50:17 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-06-15 11:23:01 +0200 |
| commit | e5f7e64960926b39133c7b223da5c82c749e364e (patch) | |
| tree | 07cfedead80593c05fa20bdfaea6cc08604b26e2 /sources/shiboken6/ApiExtractor/modifications.cpp | |
| parent | 2732a1a2182b371d8c29ed18db5db87763565518 (diff) | |
shiboken6: Add a modification for PYI types
Make it possible to directly specify the type, overriding
the modified type and the original type. This helps for
example to enclose a pointer return value within Optional[].
[ChangeLog][shiboken6] It is now possible to specify a
function argument type to appear in the .pyi files.
Task-number: PYSIDE-1329
Task-number: PYSIDE-1467
Task-number: PYSIDE-1588
Change-Id: I7a62059c1f85d09f6f607a4a8d3536894460b751
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/modifications.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/modifications.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/modifications.cpp b/sources/shiboken6/ApiExtractor/modifications.cpp index 645934e3b..318e46de1 100644 --- a/sources/shiboken6/ApiExtractor/modifications.cpp +++ b/sources/shiboken6/ApiExtractor/modifications.cpp @@ -506,6 +506,7 @@ public: QList<ReferenceCount> referenceCounts; QString modified_type; + QString pyiType; QString replacedDefaultExpression; TypeSystem::Ownership m_targetOwnerShip = TypeSystem::UnspecifiedOwnership; TypeSystem::Ownership m_nativeOwnerShip = TypeSystem::UnspecifiedOwnership; @@ -545,6 +546,17 @@ void ArgumentModification::setModifiedType(const QString &value) d->modified_type = value; } +QString ArgumentModification::pyiType() const +{ + return d->pyiType; +} + +void ArgumentModification::setPyiType(const QString &value) +{ + if (d->pyiType != value) + d->pyiType = value; +} + QString ArgumentModification::replacedDefaultExpression() const { return d->replacedDefaultExpression; |
