aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp12
-rw-r--r--sources/shiboken6/generator/shiboken/overloaddata.cpp12
-rw-r--r--sources/shiboken6/generator/shiboken/overloaddata.h2
3 files changed, 7 insertions, 19 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;
}
diff --git a/sources/shiboken6/generator/shiboken/overloaddata.cpp b/sources/shiboken6/generator/shiboken/overloaddata.cpp
index c6e2b5d83..63511ff69 100644
--- a/sources/shiboken6/generator/shiboken/overloaddata.cpp
+++ b/sources/shiboken6/generator/shiboken/overloaddata.cpp
@@ -733,18 +733,6 @@ int OverloadData::numberOfRemovedArguments(const AbstractMetaFunctionCPtr &func,
return removed;
}
-bool OverloadData::isSingleArgument(const AbstractMetaFunctionCList &overloads)
-{
- bool singleArgument = true;
- for (const auto &func : overloads) {
- if (func->arguments().size() - numberOfRemovedArguments(func) != 1) {
- singleArgument = false;
- break;
- }
- }
- return singleArgument;
-}
-
void OverloadData::dumpGraph(const QString &filename) const
{
QFile file(filename);
diff --git a/sources/shiboken6/generator/shiboken/overloaddata.h b/sources/shiboken6/generator/shiboken/overloaddata.h
index 0271fd3d0..146310bdd 100644
--- a/sources/shiboken6/generator/shiboken/overloaddata.h
+++ b/sources/shiboken6/generator/shiboken/overloaddata.h
@@ -174,8 +174,6 @@ public:
static int numberOfRemovedArguments(const AbstractMetaFunctionCPtr &func);
static int numberOfRemovedArguments(const AbstractMetaFunctionCPtr &func, int finalArgPos);
- /// Returns true if all overloads have no more than one argument.
- static bool isSingleArgument(const AbstractMetaFunctionCList &overloads);
void dumpGraph(const QString &filename) const;
QString dumpGraph() const;