aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator/shiboken/cppgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp')
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 15f2012ab..424d2fbe6 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -3541,12 +3541,14 @@ QString CppGenerator::argumentNameFromIndex(const ApiExtractorResult &api,
*wrappedClass = AbstractMetaClass::findClass(api.classes(), argType.typeEntry());
if (*wrappedClass == nullptr && errorMessage != nullptr)
*errorMessage = msgClassNotFound(argType.typeEntry());
- if (argIndex == 1
- && !func->isConstructor()
- && OverloadData::isSingleArgument(getFunctionGroups(func->implementingClass()).value(func->name())))
- pyArgName = QLatin1String(PYTHON_ARG);
- else
+ if (argIndex != 1) {
pyArgName = pythonArgsAt(argIndex - 1);
+ } else {
+ OverloadData data(getFunctionGroups(func->implementingClass()).value(func->name()),
+ api);
+ pyArgName = data.pythonFunctionWrapperUsesListOfArguments()
+ ? pythonArgsAt(argIndex - 1) : QLatin1String(PYTHON_ARG);
+ }
}
return pyArgName;
}