aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-19 14:13:05 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-19 13:45:32 +0000
commit666a3522b3054c4721d7f61b3612ce6c0fc3705b (patch)
tree944dea2d76c48e3d4e344432adc279a8358f4a39 /sources
parent64a197d5cb84d15ba5eb739901344c8513dec7ec (diff)
shiboken6: Remove need to repeat signature when modifying a global function
Grab the signature from the top element. Fixes: PYSIDE-1424 Change-Id: Ife5178e1f30ed4ebd4420f31a608bed291966aa0 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp6
-rw-r--r--sources/shiboken6/tests/samplebinding/typesystem_sample.xml4
2 files changed, 8 insertions, 2 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index 530be15ab..d71029a03 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -2357,6 +2357,12 @@ bool TypeSystemParser::parseModifyFunction(const QXmlStreamReader &reader,
}
}
+ // Child of global <function>
+ if (originalSignature.isEmpty() && topElement.entry->isFunction()) {
+ auto f = static_cast<const FunctionTypeEntry *>(topElement.entry);
+ originalSignature = f->signatures().value(0);
+ }
+
const QString signature = TypeDatabase::normalizedSignature(originalSignature);
if (signature.isEmpty()) {
m_error = QLatin1String("No signature for modified function");
diff --git a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml
index b310f8d62..e1c5ab74a 100644
--- a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml
+++ b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml
@@ -200,7 +200,7 @@
to a primitive type (PStr*) without help from the binding
developer.
-->
- <modify-function signature="changePStr(PStr*, const char*)">
+ <modify-function>
<modify-argument index="1">
<replace-type modified-type="PStr"/>
</modify-argument>
@@ -215,7 +215,7 @@
</function>
<function signature="duplicatePStr(PStr*)">
- <modify-function signature="duplicatePStr(PStr*)">
+ <modify-function>
<modify-argument index="return">
<replace-type modified-type="PyObject"/>
</modify-argument>