aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-29 14:27:37 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-30 16:57:07 +0200
commit63462f2c1bc49663dbe9bbfe786f9345c5d3f76b (patch)
tree2a304edc5d1ddf674b207743da1f01e38089b3e9 /sources
parent3eea22494846e31589555d1f9d38ba2600327e85 (diff)
shiboken2: Do not strip arguments of unknown types of virtual functions
shiboken2 would strip arguments of unknown types with default values off the function as a convenience. This should not happen for virtual functions since the wrapper will then generate an invalid override functions (happens in Qt 6 for virtual QSGTextureWrapper::removedFromAtlas(QRhiResourceUpdateBatch *) since QRhiResourceUpdateBatch is currently still private). Task-number: PYSIDE-904 Change-Id: I0216e8329820dcda4556e1b685333005db0cf58c Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index 093b2fb68..2364cec7a 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -1863,7 +1863,9 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
AbstractMetaType *metaType = translateType(arg->type(), currentClass, {}, &errorMessage);
if (!metaType) {
// If an invalid argument has a default value, simply remove it
- if (arg->defaultValue()) {
+ // unless the function is virtual (since the override in the
+ // wrapper can then not correctly be generated).
+ if (arg->defaultValue() && !functionItem->isVirtual()) {
if (!currentClass
|| (currentClass->typeEntry()->codeGeneration()
& TypeEntry::GenerateTargetLang)) {